pub struct Parser<'a> { /* private fields */ }
Expand description
The command line parser.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn opt<T>(&mut self, var: T) -> &mut Opt<'a>where
T: 'a + CommandLineArgument,
pub fn opt<T>(&mut self, var: T) -> &mut Opt<'a>where
T: 'a + CommandLineArgument,
Add and return an option.
var
is the associated variable
Sourcepub fn param<T>(&mut self, var: T) -> &mut Param<'a>where
T: 'a + CommandLineArgument,
pub fn param<T>(&mut self, var: T) -> &mut Param<'a>where
T: 'a + CommandLineArgument,
Add and return a parameter.
var
is the associated variable
Sourcepub fn auto_shorts(&mut self, auto_shorts: bool)
pub fn auto_shorts(&mut self, auto_shorts: bool)
Set whether short options should be generated automatically.
Sourcepub fn command_name(&mut self, command_name: &'a str)
pub fn command_name(&mut self, command_name: &'a str)
Set the command name.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> !RefUnwindSafe for Parser<'a>
impl<'a> !Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> !UnwindSafe for Parser<'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