pub struct ParsedArgs { /* private fields */ }
Expand description
Contains an argument list in parsed format.
Implementations§
Source§impl ParsedArgs
impl ParsedArgs
Sourcepub fn has_flag(&self, name: &str) -> bool
pub fn has_flag(&self, name: &str) -> bool
Returns true
if the specified flag was in the argument list.
Sourcepub fn get_param(&self, name: &str) -> Option<&str>
pub fn get_param(&self, name: &str) -> Option<&str>
Returns the value that is associated with the specified parameter.
Sourcepub fn get_param_as<T: FromStr>(&self, name: &str) -> Option<Result<T, T::Err>>
pub fn get_param_as<T: FromStr>(&self, name: &str) -> Option<Result<T, T::Err>>
Returns the value that is associated with the specified parameter parsed to the specified type.
Sourcepub fn unnamed_params(&self) -> &Vec<String>
pub fn unnamed_params(&self) -> &Vec<String>
Returns a reference to the vector of unnamed parameters.
Sourcepub fn get_subcommand(&self) -> Option<&str>
pub fn get_subcommand(&self) -> Option<&str>
Returns a reference to the name of the subcommand that is being invoked.
Sourcepub fn subcommand_args(&self) -> &Vec<String>
pub fn subcommand_args(&self) -> &Vec<String>
Returns a reference to the vector that holds the arguments for the subcommand which is being invoked.
Auto Trait Implementations§
impl Freeze for ParsedArgs
impl RefUnwindSafe for ParsedArgs
impl Send for ParsedArgs
impl Sync for ParsedArgs
impl Unpin for ParsedArgs
impl UnwindSafe for ParsedArgs
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