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
Fields
char: charThe character at the beginning of each argument.
s_txt: charThe single character for the short argument.
l_txt: StringThe word for the long argument.
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
Fields
char: charThe character at the beginning of the argument.
txt: StringThe word for the argument.
Long
Key::Long represents a full name argument like --all.
let key: jargon_args::Key = "--all".into();
assert!(key.is_long())Short
Fields
char: charThe character at the beginning of the argument.
txt: charThe character for the argument.
Short
Key::Short represents a single letter argument like -a.
let key: jargon_args::Key = "-a".into();
assert!(key.is_short())Sub
Fields
txt: StringThe word for the subcommand.
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())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
