pub struct Results<'a> {
pub path: &'a str,
pub flags: HashMap<&'a str, i32>,
pub args: HashMap<&'a str, Value>,
pub unknown_args: Vec<String>,
pub positional: Vec<String>,
}
Expand description
Results object returned by arg parsing (or passed to the handler)
Fields§
§path: &'a str
the Args struct we matched’s path, used to uniquely identify the command/subcommand
flags: HashMap<&'a str, i32>
mapping of flags to the number of times they were seen
args: HashMap<&'a str, Value>
mapping of args to the values seen for them if it is specified that the arg should only match one time this will be a single Value, otherwise it will be a Value::Array
unknown_args: Vec<String>
list of params seen that were not recognised
positional: Vec<String>
list of positional arguments seen note that while in the current implementation these can be interspersed between args, e.g –flag positional –flag2 is considered valid we do not guarantee that this will be true in future versions
Trait Implementations§
impl<'a> StructuralPartialEq for Results<'a>
Auto Trait Implementations§
impl<'a> Freeze for Results<'a>
impl<'a> RefUnwindSafe for Results<'a>
impl<'a> Send for Results<'a>
impl<'a> Sync for Results<'a>
impl<'a> Unpin for Results<'a>
impl<'a> UnwindSafe for Results<'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