pub struct Context { /* private fields */ }Expand description
A parsing context.
This is created by Larpa when one of the entry points of the Command trait is invoked by
the user, and updated as arguments are parsed.
Some built-in types like Color and Verbosity will be stored in the Context when
they are encountered on the command line, and can be fetched from user-defined callbacks when
desired.
Implementations§
Source§impl Context
impl Context
Sourcepub fn verbosity(&self) -> Verbosity
pub fn verbosity(&self) -> Verbosity
Returns the current Verbosity level.
If a flag is declared with type Verbosity, and time it (or its inverse_of) is
encountered on the command line, the field value is incremented (or decremented) and stored
in the Context.
Sourcepub fn command_desc(&self) -> &CommandDesc
pub fn command_desc(&self) -> &CommandDesc
Returns the CommandDesc of the subcommand currently being parsed.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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