[][src]Trait entrance::Options

pub trait Options: Sized {
    fn parse<I: Iterator<Item = OptionItem>>(
        options: I
    ) -> Result<Self, OptionError>;
fn spec() -> &'static [Opt]; }

A trait for parsing and containing options.

Example

use entrance::Options;

#[derive(Options)]
struct Opts {
    #[description = "Print help message"]
    #[short = 'h']
    help: bool,

    #[description = "Print version infomation"]
    version: bool,
}

Required methods

fn parse<I: Iterator<Item = OptionItem>>(
    options: I
) -> Result<Self, OptionError>

fn spec() -> &'static [Opt]

This associated function is for HelpDisplay.

Loading content...

Implementations on Foreign Types

impl Options for ()[src]

Loading content...

Implementors

Loading content...