Struct clargs::ParsingResults
[−]
[src]
pub struct ParsingResults { /* fields omitted */ }
Returned after successfully parsing command-line arguments.
Contains all the parsed results of the arguments with methods to retrieve those results.
Methods
impl ParsingResults
[src]
fn new() -> ParsingResults
[src]
Constructs and returns a new ParsingResults
object.
fn path(&self) -> &String
[src]
Returns a reference to the stored path.
fn path_mut(&mut self) -> &mut String
[src]
Returns a mutable reference to the stored path.
fn flags(&self) -> &HashSet<String>
[src]
Returns a reference to the stored set of flags.
fn flags_mut(&mut self) -> &mut HashSet<String>
[src]
Returns a mutable reference to the stored set of flags.
fn named_params(&self) -> &HashMap<String, Box<Any>>
[src]
Returns a reference to the stored map of named parameters to their respective values.
fn named_params_mut(&mut self) -> &mut HashMap<String, Box<Any>>
[src]
Returns a mutable reference to the stored map of named parameters to their respective values.
fn unnamed_params(&self) -> &Vec<String>
[src]
Returns a reference to the stored vector of unnamed parameters.
fn unnamed_params_mut(&mut self) -> &mut Vec<String>
[src]
Returns a mutable reference to the stored vector of unnamed parameters.
fn flag(&self, name: &str) -> bool
[src]
Returns true
if a flag with the specified name
was set in the parsed arguments.
fn named_param<T: 'static + FromStr>(&self, name: &str) -> Option<&T>
[src]
Returns a reference to the specified named parameter's value.
If no such parameter was set in the parsed arguments, returns None
.
Panics
Panics if the specified type does not match the specified parameter's associated type.
fn named_param_mut<T: 'static + FromStr>(
&mut self,
name: &str
) -> Option<&mut T>
[src]
&mut self,
name: &str
) -> Option<&mut T>
Returns a mutable reference to the specified named parameter's value.
If no such parameter was set in the parsed arguments, returns None
.
Panics
Panics if the specified type does not match the specified parameter's associated type.
fn num_unnamed_params(&self) -> usize
[src]
Returns the number of stored unnamed parameters.
fn unnamed_param(&self, index: usize) -> &String
[src]
Returns a reference to the unnamed parameter at the specified zero-based index
.
Panics
Panics if the index
is higher than or equal to the number of stored unnamed parameters.
fn unnamed_param_mut(&mut self, index: usize) -> &mut String
[src]
Returns a mutable reference to the unnamed parameter at the specified zero-based index
.
Panics
Panics if the index
is higher than or equal to the number of stored unnamed parameters.
Trait Implementations
impl Default for ParsingResults
[src]
fn default() -> ParsingResults
[src]
Returns the "default value" for a type. Read more