pub struct Command(/* private fields */);Implementations§
Source§impl Command
impl Command
pub const MAX_CHAR_LENGTH: usize = 40usize
Sourcepub fn new<T: AsRef<str> + Into<CompactString>>(
command: T,
) -> Result<Self, CommandError>
pub fn new<T: AsRef<str> + Into<CompactString>>( command: T, ) -> Result<Self, CommandError>
Sourcepub unsafe fn new_unchecked<T: Into<CompactString>>(command: T) -> Self
pub unsafe fn new_unchecked<T: Into<CompactString>>(command: T) -> Self
Creates a new Command from any type that implements Into<CompactString> without
checking its validity.
§Safety
The command must not be empty or more than 40 characters long.
Trait Implementations§
Source§impl Ord for Command
impl Ord for Command
Source§impl PartialOrd for Command
impl PartialOrd for Command
Source§impl TryFrom<CompactString> for Command
impl TryFrom<CompactString> for Command
Source§type Error = CommandError
type Error = CommandError
The type returned in the event of a conversion error.
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more