[][src]Trait simon::Arg

pub trait Arg: Sized {
    type Item;
    type Error: Debug + Display;
    fn update_switches<S: Switches>(&self, switches: &mut S);
fn name(&self) -> String;
fn get(self, matches: &Matches) -> Result<Self::Item, Self::Error>; fn validate(&self) -> Result<(), Invalid> { ... }
fn parse_specified_ignoring_validation<I>(
        self,
        program_name: String,
        args: I
    ) -> ParseResult<Self::Item, Self::Error>
    where
        I: IntoIterator,
        I::Item: AsRef<OsStr>
, { ... }
fn parse_specified<I>(
        self,
        program_name: String,
        args: I
    ) -> ParseResult<Self::Item, Self::Error>
    where
        I: IntoIterator,
        I::Item: AsRef<OsStr>
, { ... }
fn parse_env(self) -> ParseResult<Self::Item, Self::Error> { ... }
fn with_help(self, help_flag: Flag) -> WithHelp<Self> { ... }
fn with_help_default(self) -> WithHelp<Self> { ... }
fn option_map<F, T, U>(self, f: F) -> OptionMap<Self, F>
    where
        F: FnOnce(T) -> U
, { ... }
fn with_default<T>(self, default_value: T) -> WithDefault<Self, T> { ... }
fn choice<O>(self, other: O) -> Choice<Self, O>
    where
        O: Arg<Item = Self::Item>
, { ... }
fn both<O>(self, other: O) -> Both<Self, O>
    where
        O: Arg
, { ... }
fn map<F, U>(self, f: F) -> Map<Self, F>
    where
        F: FnOnce(Self::Item) -> U
, { ... }
fn required(self) -> Required<Self> { ... }
fn convert_string<F, T, E>(self, f: F) -> ConvertString<Self, F>
    where
        F: FnOnce(&str) -> Result<T, E>
, { ... }
fn option_convert_string<F, T, E>(
        self,
        f: F
    ) -> OptionConvertString<Self, F>
    where
        F: FnOnce(&str) -> Result<T, E>
, { ... }
fn vec_convert_string<F, T, E>(self, f: F) -> VecConvertString<Self, F>
    where
        F: FnMut(&str) -> Result<T, E>
, { ... }
fn depend<O>(self, other: O) -> Depend<Self, O>
    where
        O: Arg
, { ... }
fn some_if<T>(self, t: T) -> SomeIf<Self, T> { ... } }

Associated Types

type Item

type Error: Debug + Display

Loading content...

Required methods

fn update_switches<S: Switches>(&self, switches: &mut S)

fn name(&self) -> String

fn get(self, matches: &Matches) -> Result<Self::Item, Self::Error>

Loading content...

Provided methods

fn validate(&self) -> Result<(), Invalid>

fn parse_specified_ignoring_validation<I>(
    self,
    program_name: String,
    args: I
) -> ParseResult<Self::Item, Self::Error> where
    I: IntoIterator,
    I::Item: AsRef<OsStr>, 

fn parse_specified<I>(
    self,
    program_name: String,
    args: I
) -> ParseResult<Self::Item, Self::Error> where
    I: IntoIterator,
    I::Item: AsRef<OsStr>, 

fn parse_env(self) -> ParseResult<Self::Item, Self::Error>

fn with_help(self, help_flag: Flag) -> WithHelp<Self>

fn with_help_default(self) -> WithHelp<Self>

fn option_map<F, T, U>(self, f: F) -> OptionMap<Self, F> where
    F: FnOnce(T) -> U, 

fn with_default<T>(self, default_value: T) -> WithDefault<Self, T>

fn choice<O>(self, other: O) -> Choice<Self, O> where
    O: Arg<Item = Self::Item>, 

fn both<O>(self, other: O) -> Both<Self, O> where
    O: Arg

fn map<F, U>(self, f: F) -> Map<Self, F> where
    F: FnOnce(Self::Item) -> U, 

fn required(self) -> Required<Self>

fn convert_string<F, T, E>(self, f: F) -> ConvertString<Self, F> where
    F: FnOnce(&str) -> Result<T, E>, 

fn option_convert_string<F, T, E>(self, f: F) -> OptionConvertString<Self, F> where
    F: FnOnce(&str) -> Result<T, E>, 

fn vec_convert_string<F, T, E>(self, f: F) -> VecConvertString<Self, F> where
    F: FnMut(&str) -> Result<T, E>, 

fn depend<O>(self, other: O) -> Depend<Self, O> where
    O: Arg

fn some_if<T>(self, t: T) -> SomeIf<Self, T>

Loading content...

Implementors

impl Arg for Flag[src]

type Item = bool

type Error = Never

impl Arg for Free[src]

type Item = Vec<String>

type Error = Never

impl Arg for Opt[src]

type Item = Option<String>

type Error = Never

impl<A> Arg for WithHelp<A> where
    A: Arg
[src]

type Item = OrHelp<A::Item>

type Error = A::Error

impl<A, B> Arg for Both<A, B> where
    A: Arg,
    B: Arg
[src]

type Item = (A::Item, B::Item)

type Error = BothError<A::Error, B::Error>

impl<A, B, T> Arg for Choice<A, B> where
    A: Arg<Item = Option<T>>,
    B: Arg<Item = Option<T>>, 
[src]

type Item = Option<T>

type Error = ChoiceError<A::Error, B::Error>

impl<A, F, T, E> Arg for ConvertString<A, F> where
    A: Arg<Item = String>,
    F: FnOnce(&str) -> Result<T, E>,
    E: Display + Debug
[src]

type Item = T

type Error = ConvertStringError<A::Error, E>

impl<A, F, T, E> Arg for OptionConvertString<A, F> where
    A: Arg<Item = Option<String>>,
    F: FnOnce(&str) -> Result<T, E>,
    E: Display + Debug
[src]

type Item = Option<T>

type Error = OptionConvertStringError<A::Error, E>

impl<A, F, T, E> Arg for VecConvertString<A, F> where
    A: Arg<Item = Vec<String>>,
    F: FnMut(&str) -> Result<T, E>,
    E: Display + Debug
[src]

type Item = Vec<T>

type Error = VecConvertStringError<A::Error, E>

impl<A, F, T, U> Arg for OptionMap<A, F> where
    A: Arg<Item = Option<T>>,
    F: FnOnce(T) -> U, 
[src]

type Item = Option<U>

type Error = A::Error

impl<A, T> Arg for Required<A> where
    A: Arg<Item = Option<T>>, 
[src]

type Item = T

type Error = RequiredError<A::Error>

impl<A, T> Arg for SomeIf<A, T> where
    A: Arg<Item = bool>, 
[src]

type Item = Option<T>

type Error = A::Error

impl<A, T> Arg for WithDefault<A, T> where
    A: Arg<Item = Option<T>>, 
[src]

type Item = T

type Error = A::Error

impl<A, U, F> Arg for Map<A, F> where
    A: Arg,
    F: FnOnce(A::Item) -> U, 
[src]

type Item = U

type Error = A::Error

impl<T> Arg for Value<T>[src]

type Item = T

type Error = Never

impl<T, U, A, B> Arg for Depend<A, B> where
    A: Arg<Item = Option<T>>,
    B: Arg<Item = Option<U>>, 
[src]

type Item = Option<(T, U)>

type Error = DependError<A::Error, B::Error>

Loading content...