pub struct Arguments<'a> { /* private fields */ }Expand description
Stores the arguments of the parser.
Implementations§
Source§impl<'a> Arguments<'a>
impl<'a> Arguments<'a>
Sourcepub fn single_value(&self, arg_name: &'static str) -> Option<&String>
pub fn single_value(&self, arg_name: &'static str) -> Option<&String>
Return the value of an argument if the argument exists and has the type String. Otherwise return None.
Sourcepub fn flag_present(&self, arg_name: &'static str) -> bool
pub fn flag_present(&self, arg_name: &'static str) -> bool
Return whether an arg_name argument of type flag exists.
Sourcepub fn multiple_values(&self, arg_name: &'static str) -> Option<&[String]>
pub fn multiple_values(&self, arg_name: &'static str) -> Option<&[String]>
Return the value of an argument if the argument exists and has the type vector. Otherwise return None.
Sourcepub fn extra_args(&self) -> Vec<String>
pub fn extra_args(&self) -> Vec<String>
Get the extra arguments (all arguments after --).
Sourcepub fn parse_from_cmdline(&mut self) -> Result<()>
pub fn parse_from_cmdline(&mut self) -> Result<()>
Collect the command line arguments and the values provided for them.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Arguments<'a>
impl<'a> RefUnwindSafe for Arguments<'a>
impl<'a> Send for Arguments<'a>
impl<'a> Sync for Arguments<'a>
impl<'a> Unpin for Arguments<'a>
impl<'a> UnwindSafe for Arguments<'a>
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