pub enum ArgType {
Option,
Flag,
List,
Dict,
Positional(u8),
}
Expand description
This enum represents the different types of arguments supported
Variants§
Option
An argument that takes a value, as in ./go --pic lol.jpg
Flag
An argument that is a simple flag, as in rustc --version
List
Like an Option
, but takes multiple values, as in
./go --pics 1.png 2.png 3.png
Dict
Like a List
but takes colon-split key-value pairs, as in
./go --pics Monday:1.jpg Tuesday:2.jpg
Positional(u8)
A positional argument, as in rustc lib.rs
. The u8 indicates
The relative position of the position argument (i.e. Positional(0)
indicates that this is the first positional argument
Trait Implementations§
impl StructuralPartialEq for ArgType
Auto Trait Implementations§
impl Freeze for ArgType
impl RefUnwindSafe for ArgType
impl Send for ArgType
impl Sync for ArgType
impl Unpin for ArgType
impl UnwindSafe for ArgType
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