Struct bdk_chain::bitcoin::p2p::message::CommandString
pub struct CommandString(/* private fields */);
Expand description
Serializer for command string
Implementations§
§impl CommandString
impl CommandString
pub fn try_from_static(
s: &'static str
) -> Result<CommandString, CommandStringError>
pub fn try_from_static( s: &'static str ) -> Result<CommandString, CommandStringError>
Converts &'static str
to CommandString
This is more efficient for string literals than non-static conversions because it avoids allocation.
§Errors
Returns an error if, and only if, the string is larger than 12 characters in length.
Trait Implementations§
§impl AsRef<str> for CommandString
impl AsRef<str> for CommandString
§impl Clone for CommandString
impl Clone for CommandString
§fn clone(&self) -> CommandString
fn clone(&self) -> CommandString
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for CommandString
impl Debug for CommandString
§impl Decodable for CommandString
impl Decodable for CommandString
§impl Display for CommandString
impl Display for CommandString
§impl Encodable for CommandString
impl Encodable for CommandString
§impl FromStr for CommandString
impl FromStr for CommandString
§type Err = CommandStringError
type Err = CommandStringError
The associated error which can be returned from parsing.
§fn from_str(s: &str) -> Result<CommandString, <CommandString as FromStr>::Err>
fn from_str(s: &str) -> Result<CommandString, <CommandString as FromStr>::Err>
Parses a string
s
to return a value of this type. Read more§impl PartialEq for CommandString
impl PartialEq for CommandString
§fn eq(&self, other: &CommandString) -> bool
fn eq(&self, other: &CommandString) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<'a> TryFrom<&'a str> for CommandString
impl<'a> TryFrom<&'a str> for CommandString
§type Error = CommandStringError
type Error = CommandStringError
The type returned in the event of a conversion error.
§fn try_from(
value: &'a str
) -> Result<CommandString, <CommandString as TryFrom<&'a str>>::Error>
fn try_from( value: &'a str ) -> Result<CommandString, <CommandString as TryFrom<&'a str>>::Error>
Performs the conversion.
§impl TryFrom<Box<str>> for CommandString
impl TryFrom<Box<str>> for CommandString
§type Error = CommandStringError
type Error = CommandStringError
The type returned in the event of a conversion error.
§impl TryFrom<String> for CommandString
impl TryFrom<String> for CommandString
§type Error = CommandStringError
type Error = CommandStringError
The type returned in the event of a conversion error.
§fn try_from(
value: String
) -> Result<CommandString, <CommandString as TryFrom<String>>::Error>
fn try_from( value: String ) -> Result<CommandString, <CommandString as TryFrom<String>>::Error>
Performs the conversion.
impl Eq for CommandString
impl StructuralPartialEq for CommandString
Auto Trait Implementations§
impl Freeze for CommandString
impl RefUnwindSafe for CommandString
impl Send for CommandString
impl Sync for CommandString
impl Unpin for CommandString
impl UnwindSafe for CommandString
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more