pub struct Argument {
pub name: String,
pub description: String,
pub aliases: Vec<String>,
pub value: Option<String>,
pub required: bool,
}Fields§
§name: StringCanonical Argument name, for example: “verbose”.
description: StringHuman-readable description for help output.
aliases: Vec<String>Alternative spellings accepted during parsing.
value: Option<String>Numeric payload that can be mapped to an enum or bit mask.
required: boolWhether this argument is required or optional.
Implementations§
Source§impl Argument
impl Argument
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Creates a Argument declaration with the given numeric payload.
Sourcepub fn with_aliases(self, aliases: Vec<impl Into<String>>) -> Self
pub fn with_aliases(self, aliases: Vec<impl Into<String>>) -> Self
Adds alias spellings for this Argument.
Sourcepub fn set_required(self) -> Self
pub fn set_required(self) -> Self
Sets required to true, indicating this argument is required.
Trait Implementations§
impl Eq for Argument
impl StructuralPartialEq for Argument
Auto Trait Implementations§
impl Freeze for Argument
impl RefUnwindSafe for Argument
impl Send for Argument
impl Sync for Argument
impl Unpin for Argument
impl UnsafeUnpin for Argument
impl UnwindSafe for Argument
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