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 duplicate 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§fn consensus_decode<R>(r: &mut R) -> Result<CommandString, Error>
fn consensus_decode<R>(r: &mut R) -> Result<CommandString, Error>
Decode an object with a well-defined format. Read more
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§type Err = CommandStringError
type Err = CommandStringError
The associated error which can be returned from parsing.
Source§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 moreSource§impl PartialEq for CommandString
impl PartialEq for CommandString
Source§impl<'a> TryFrom<&'a str> for CommandString
impl<'a> TryFrom<&'a str> for CommandString
Source§type Error = CommandStringError
type Error = CommandStringError
The type returned in the event of a conversion error.
Source§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.
Source§impl TryFrom<String> for CommandString
impl TryFrom<String> for CommandString
Source§type Error = CommandStringError
type Error = CommandStringError
The type returned in the event of a conversion error.
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.