Struct bitcoin::p2p::message::CommandString
source · pub struct CommandString(/* private fields */);
Expand description
Serializer for command string
Implementations§
source§impl CommandString
impl CommandString
sourcepub 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§
source§impl AsRef<str> for CommandString
impl AsRef<str> for CommandString
source§impl Clone for CommandString
impl Clone for CommandString
source§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 moresource§impl Debug for CommandString
impl Debug for CommandString
source§impl Decodable for CommandString
impl Decodable for CommandString
source§impl Display for CommandString
impl Display for CommandString
source§impl Encodable for CommandString
impl Encodable for CommandString
source§impl FromStr for CommandString
impl FromStr for CommandString
source§impl PartialEq<CommandString> for CommandString
impl PartialEq<CommandString> for CommandString
source§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 ==
.source§impl<'a> TryFrom<&'a str> for CommandString
impl<'a> TryFrom<&'a str> for CommandString
source§impl TryFrom<String> for CommandString
impl TryFrom<String> for CommandString
impl Eq for CommandString
impl StructuralEq for CommandString
impl StructuralPartialEq for CommandString
Auto Trait Implementations§
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