pub struct Argument { /* private fields */ }
Implementations§
Source§impl Argument
impl Argument
Sourcepub fn is_required(self, required: bool) -> Self
pub fn is_required(self, required: bool) -> Self
Sets the Argument explicitly as required or not.
Sourcepub fn with_type(self, arg_type: ArgumentType) -> Self
pub fn with_type(self, arg_type: ArgumentType) -> Self
Sets the type for the ArgumentParser to parse the arguments value into.
Sourcepub fn with_description(self, description: &str) -> Self
pub fn with_description(self, description: &str) -> Self
Sets the description (Help string) of the argument for
Sourcepub fn with_default_value(self, value: ArgumentValue) -> Self
pub fn with_default_value(self, value: ArgumentValue) -> Self
Sets the default value if the argument type matches the value or panics
pub fn arg_type(&self) -> ArgumentType
pub fn name(&self) -> &str
pub fn default_value(&self) -> ArgumentValue
pub fn description(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Argument
impl RefUnwindSafe for Argument
impl Send for Argument
impl Sync for Argument
impl Unpin 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