#[non_exhaustive]pub enum CommandArg {
Flag(ParsedFlag),
Positional(String),
}Expand description
An argument in a parsed command line.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Flag(ParsedFlag)
A flag token (e.g., --force, -f, --color=always).
Positional(String)
A non-flag token (subcommand, path, or other argument).
Trait Implementations§
Source§impl Clone for CommandArg
impl Clone for CommandArg
Source§fn clone(&self) -> CommandArg
fn clone(&self) -> CommandArg
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CommandArg
impl Debug for CommandArg
Source§impl PartialEq for CommandArg
impl PartialEq for CommandArg
Source§fn eq(&self, other: &CommandArg) -> bool
fn eq(&self, other: &CommandArg) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CommandArg
impl StructuralPartialEq for CommandArg
Auto Trait Implementations§
impl Freeze for CommandArg
impl RefUnwindSafe for CommandArg
impl Send for CommandArg
impl Sync for CommandArg
impl Unpin for CommandArg
impl UnsafeUnpin for CommandArg
impl UnwindSafe for CommandArg
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