[][src]Struct rustop::Parser

pub struct Parser<'a> { /* fields omitted */ }

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]

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]

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]

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

impl<'a> Default for Parser<'a>[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.