[−][src]Struct rustop::Parser
The command line parser.
Implementations
impl<'a> Parser<'a>
[src]
pub fn new() -> Parser<'a>
[src]
Return a new parser.
pub fn opt<T>(&mut self, var: T) -> &mut Opt<'a> where
T: 'a + CommandLineArgument,
[src]
T: 'a + CommandLineArgument,
Add and return an option.
var
is the associated variable
pub fn param<T>(&mut self, var: T) -> &mut Param<'a> where
T: 'a + CommandLineArgument,
[src]
T: 'a + CommandLineArgument,
Add and return a parameter.
var
is the associated variable
pub fn auto_shorts(&mut self, auto_shorts: bool)
[src]
Set whether short options should be generated automatically.
pub fn stop_on(&mut self, stopon: &'a str)
[src]
Specify an additional stop string.
pub fn command_name(&mut self, command_name: &'a str)
[src]
Set the command name.
pub fn usage(&mut self, usage: &'a str)
[src]
Set the usage string.
pub fn synopsis(&mut self, synopsis: &'a str)
[src]
Set the synopsis string.
pub fn version(&mut self, version: &'a str)
[src]
Set the version string.
pub fn help(&mut self, help: bool)
[src]
Add help option.
pub fn parse<'b, I>(&mut self, args: I) -> Result<Vec<&'b str>, Error> where
I: Iterator<Item = &'b str>,
[src]
I: Iterator<Item = &'b str>,
Parse vector of command line arguments.
Returns a vector of remaining (unparsed) arguments.
pub fn write_usage(&self, output: &mut dyn Write) -> Result<(), Error>
[src]
Write the usage string to some output stream.
Trait Implementations
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,