Enum jargon_args::Key [−][src]
pub enum Key {
Dual {
char: char,
s_txt: char,
l_txt: String,
},
Long {
char: char,
txt: String,
},
Short {
char: char,
txt: char,
},
Sub {
txt: String,
},
}Expand description
Key
This is the Key enum that represents processable arguments. This has four variants.
Dual
Key::Dual represents ONLY Key::Long and Key::Short in one, they both must start with the same character.
let key: jargon_args::Key = ["-a", "--all"].into();
assert!(key.is_dual())Long
Key::Long represents a full name argument like --all.
let key: jargon_args::Key = "--all".into();
assert!(key.is_long())Short
Key::Short represents a single letter argument like -a.
let key: jargon_args::Key = "-a".into();
assert!(key.is_short())sub
Key::Sub represents a subcommand argument, anything not converted into any other time becomes Key::Sub.
let key: jargon_args::Key = "list".into();
assert!(key.is_sub())Variants
Dual
Key::Dual represents ONLY Key::Long and Key::Short in one, they both must start with the same character.
let key: jargon_args::Key = ["-a", "--all"].into();
assert!(key.is_dual())Fields of Dual
Long
Key::Long represents a full name argument like --all.
let key: jargon_args::Key = "--all".into();
assert!(key.is_long())Fields of Long
Short
Key::Short represents a single letter argument like -a.
let key: jargon_args::Key = "-a".into();
assert!(key.is_short())Fields of Short
sub
Key::Sub represents a subcommand argument, anything not converted into any other time becomes Key::Sub.
let key: jargon_args::Key = "list".into();
assert!(key.is_sub())Fields of Sub
txt: StringThe word for the subcommand.
Implementations
Return the char at the beginning of each argument, Key::sub returns \0.
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Key
impl UnwindSafe for Key
Blanket Implementations
Mutably borrows from an owned value. Read more