[−][src]Struct comma::Command
Contains the result of a parsed command. See [Command::from_str
] documentation for details on
available command syntax.
Fields
name: String
The name of the command being run (i.e. the first argument)
arguments: Vec<String>
All arguments being passed
Trait Implementations
impl Clone for Command
[src]
fn clone(&self) -> Command
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Command
[src]
impl FromStr for Command
[src]
type Err = EmptyCommandError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Parse a command from the commandline. Commands consist of separate 'tokens' separated by whitespace.
Multiple whitespace characters are permitted between tokens, including at the beginning and end of the command string. All extra whitespace is stripped unless explicitly escaped using quotation marks or backslash escaping.
Preceding a character with a backslash (\
) will cause any special meaning for the
character to be ignored. To convey a real backslash in a command it must be prefixed with
another backslash, such as: (\\
).
Quotation marks surrounding a portion of text will also cause the text to be included
verbatim, including whitespace. However, backslashes retain their special meaning, to allow
for escaped quotes (\"
) inside a quoted string.
from_str
will only fail if zero tokens are provided (i.e. there is no command name). In
this case it will provide an EmptyCommandError
.
Auto Trait Implementations
impl Sync for Command
impl Send for Command
impl Unpin for Command
impl RefUnwindSafe for Command
impl UnwindSafe for Command
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,