pub struct Matches { /* private fields */ }Expand description
All parsed values and their sources. Internally keyed by flattened strings.
We add leaf_path so callers can query scoped without spelling keys.
Implementations§
Source§impl Matches
impl Matches
Sourcepub fn view(&self) -> MatchView<'_>
pub fn view(&self) -> MatchView<'_>
Scoped view at the leaf command. Most handlers will use this.
Sourcepub fn at<'a>(&'a self, path: &[&'a str]) -> MatchView<'a>
pub fn at<'a>(&'a self, path: &[&'a str]) -> MatchView<'a>
Scoped view at an explicit command path, e.g., &["remote", "add"].
Sourcepub fn get_position(&self, name: &str) -> Option<&[OsString]>
pub fn get_position(&self, name: &str) -> Option<&[OsString]>
Get a positional by name in the leaf scope as a slice (one becomes a 1‑elem slice). Returns None if not present.
Sourcepub fn get_position_one(&self, name: &str) -> Option<&OsStr>
pub fn get_position_one(&self, name: &str) -> Option<&OsStr>
Get a single positional by name in the leaf scope.
Sourcepub fn get_value(&self, name: &str) -> Option<&OsStr>
pub fn get_value(&self, name: &str) -> Option<&OsStr>
Get an option value in the leaf scope (first of many if repeated).
Sourcepub fn get_values(&self, name: &str) -> Option<&[OsString]>
pub fn get_values(&self, name: &str) -> Option<&[OsString]>
Get all values for an option in the leaf scope.
Sourcepub fn is_set(&self, name: &str) -> bool
pub fn is_set(&self, name: &str) -> bool
Test whether a flag/option was set in the leaf scope (from any Source).
Sourcepub fn is_set_from(&self, name: &str, src: Source) -> bool
pub fn is_set_from(&self, name: &str, src: Source) -> bool
Like is_set, but only if set from a specific Source.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Matches
impl RefUnwindSafe for Matches
impl Send for Matches
impl Sync for Matches
impl Unpin for Matches
impl UnwindSafe for Matches
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