pub struct Flags<'a> { /* private fields */ }Expand description
Walks a command line flag by flag.
Implementations§
Source§impl<'a> Flags<'a>
impl<'a> Flags<'a>
Sourcepub fn value(&mut self, flag: &Flag) -> Result<String, CliError>
pub fn value(&mut self, flag: &Flag) -> Result<String, CliError>
The value of flag: what followed its =, or else the next
argument, which the walk then passes over.
§Errors
CliError::MissingValue when flag is the last argument.
Sourcepub fn parsed<T: FromStr>(&mut self, flag: &Flag) -> Result<T, CliError>
pub fn parsed<T: FromStr>(&mut self, flag: &Flag) -> Result<T, CliError>
The value of flag, parsed.
§Errors
CliError::MissingValue as Self::value;
CliError::InvalidValue when the value does not parse.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Flags<'a>
impl<'a> RefUnwindSafe for Flags<'a>
impl<'a> Send for Flags<'a>
impl<'a> Sync for Flags<'a>
impl<'a> Unpin for Flags<'a>
impl<'a> UnsafeUnpin for Flags<'a>
impl<'a> UnwindSafe for Flags<'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