[][src]Struct simon::ext::ArgExt

pub struct ArgExt<A> { /* fields omitted */ }

Methods

impl<A> ArgExt<A> where
    A: Arg
[src]

pub fn parse<I>(
    &self,
    args: I
) -> (Result<A::Item, TopLevelError<A::Error>>, Usage) where
    I: IntoIterator,
    I::Item: AsRef<OsStr>, 
[src]

pub fn parse_env(
    &self,
    program_name: ProgramName
) -> (Result<A::Item, TopLevelError<A::Error>>, UsageWithProgramName)
[src]

pub fn parse_env_default(
    &self
) -> (Result<A::Item, TopLevelError<A::Error>>, UsageWithProgramName)
[src]

pub fn just_parse<I>(&self, args: I) -> Result<A::Item, TopLevelError<A::Error>> where
    I: IntoIterator,
    I::Item: AsRef<OsStr>, 
[src]

pub fn just_parse_env(
    &self,
    program_name: ProgramName
) -> Result<A::Item, TopLevelError<A::Error>>
[src]

pub fn just_parse_env_default(&self) -> Result<A::Item, TopLevelError<A::Error>>[src]

pub fn result_map<F, U, E>(self, f: F) -> ArgExt<impl Arg<Item = U, Error = E>> where
    E: Debug + Display,
    F: Fn(Result<A::Item, A::Error>) -> Result<U, E>, 
[src]

pub fn result_both<B>(
    self,
    b: B
) -> ArgExt<impl Arg<Item = (Result<A::Item, A::Error>, Result<B::Item, B::Error>), Error = Never>> where
    B: Arg,
    Self: Sized
[src]

pub fn both<B>(
    self,
    b: B
) -> ArgExt<impl Arg<Item = (A::Item, B::Item), Error = BothError<A::Error, B::Error>>> where
    B: Arg
[src]

pub fn try_map<F, U, E>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = U, Error = TryMapError<A::Error, E>>> where
    E: Debug + Display,
    F: Fn(A::Item) -> Result<U, E>, 
[src]

pub fn map<F, U>(self, f: F) -> ArgExt<impl Arg<Item = U, Error = A::Error>> where
    F: Fn(A::Item) -> U, 
[src]

pub fn convert<F, U, E>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = U, Error = TryMapError<A::Error, ConvertFailed<A::Item, E>>>> where
    A::Item: Clone + Debug + Display,
    E: Clone + Debug + Display,
    F: Fn(A::Item) -> Result<U, E>, 
[src]

pub fn with_help(self, flag: Flag) -> ArgExt<impl Arg<Item = HelpOr<A::Item>>>[src]

pub fn with_help_default(self) -> ArgExt<impl Arg<Item = HelpOr<A::Item>>>[src]

pub fn rename(
    self,
    name: &str
) -> ArgExt<impl Arg<Item = A::Item, Error = A::Error>>
[src]

pub fn valid(self) -> ArgExt<Valid<A>>[src]

impl<A, B> ArgExt<A> where
    A: Arg<Item = HelpOr<B>>, 
[src]

pub fn parse_env_or_exit(&self, program_name: ProgramName) -> B[src]

pub fn parse_env_default_or_exit(&self) -> B[src]

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

pub fn depend<B, U>(
    self,
    b: B
) -> ArgExt<impl Arg<Item = Option<(T, U)>, Error = DependError<A::Error, B::Error>>> where
    B: Arg<Item = Option<U>>, 
[src]

pub fn otherwise<U>(self, b: U) -> ArgExt<impl Arg<Item = Either<T, U::Item>>> where
    U: Arg
[src]

pub fn option_try_map<F, U, E>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = TryMapError<A::Error, E>>> where
    E: Debug + Display,
    F: Fn(T) -> Result<U, E>, 
[src]

pub fn option_map<F, U>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = A::Error>> where
    F: Fn(T) -> U, 
[src]

pub fn either_or_both_any<B, U>(
    self,
    b: B
) -> ArgExt<impl Arg<Item = Option<EitherOrBoth<T, U>>>> where
    B: Arg<Item = Option<U>>, 
[src]

pub fn either_any<B, U>(
    self,
    b: B
) -> ArgExt<impl Arg<Item = Option<Either<T, U>>>> where
    B: Arg<Item = Option<U>>, 
[src]

pub fn either<B>(self, b: B) -> ArgExt<impl Arg<Item = Option<T>>> where
    B: Arg<Item = Option<T>>, 
[src]

pub fn with_default_lazy<F: Fn() -> T>(self, f: F) -> ArgExt<impl Arg<Item = T>>[src]

pub fn with_default(self, t: T) -> ArgExt<impl Arg<Item = T>> where
    T: Clone
[src]

pub fn required(
    self
) -> ArgExt<impl Arg<Item = T, Error = TryMapError<A::Error, MissingRequiredArg>>>
[src]

pub fn option_convert<F, U, E>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = TryMapError<A::Error, ConvertFailed<T, E>>>> where
    T: Clone + Debug + Display,
    E: Clone + Debug + Display,
    F: Fn(T) -> Result<U, E>, 
[src]

impl<A> ArgExt<A> where
    A: Arg<Item = bool>, 
[src]

pub fn some_if_lazy<T, F>(self, f: F) -> ArgExt<impl Arg<Item = Option<T>>> where
    F: Fn() -> T, 
[src]

pub fn some_if<T>(self, t: T) -> ArgExt<impl Arg<Item = Option<T>>> where
    T: Clone
[src]

pub fn unit_option(self) -> ArgExt<impl Arg<Item = Option<()>>>[src]

pub fn unless<U>(self, b: U) -> ArgExt<impl Arg<Item = Option<U::Item>>> where
    U: Arg
[src]

impl<A, I> ArgExt<A> where
    A: Arg<Item = I>,
    I: IntoIterator
[src]

pub fn into_iter(self) -> ArgExt<impl Arg<Item = I::IntoIter>>[src]

pub fn vec_try_map<F, U, E>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = TryMapError<A::Error, E>>> where
    E: Debug + Display,
    F: Fn(I::Item) -> Result<U, E>, 
[src]

pub fn vec_map<F, U>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = A::Error>> where
    F: Fn(I::Item) -> U, 
[src]

pub fn vec_convert<F, U, E>(
    self,
    f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = TryMapError<A::Error, ConvertFailed<I::Item, E>>>> where
    I::Item: Clone + Debug + Display,
    E: Clone + Debug + Display,
    F: Fn(I::Item) -> Result<U, E>, 
[src]

impl<A, I, T, E> ArgExt<A> where
    E: Debug + Display,
    A: Arg<Item = I>,
    I: IntoIterator<Item = Result<T, E>>, 
[src]

pub fn vec_ok_or_first_err(
    self
) -> ArgExt<impl Arg<Item = Vec<T>, Error = TryMapError<A::Error, E>>>
[src]

impl<A, I> ArgExt<A> where
    A: Arg<Item = I>,
    I: Iterator
[src]

pub fn collect<C>(self) -> ArgExt<impl Arg<Item = C>> where
    C: FromIterator<I::Item>, 
[src]

Trait Implementations

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

type Item = A::Item

type Error = A::Error

fn validate(&self) -> Option<Invalid>[src]

Auto Trait Implementations

impl<A> Send for ArgExt<A> where
    A: Send

impl<A> Sync for ArgExt<A> where
    A: Sync

Blanket Implementations

impl<A, D> Arg for D where
    A: Arg,
    D: Deref<Target = A>, 
[src]

type Item = <A as Arg>::Item

type Error = <A as Arg>::Error

fn validate(&self) -> Option<Invalid>[src]

fn parse<I>(
    &self,
    args: I
) -> (Result<Self::Item, TopLevelError<Self::Error>>, Usage) where
    I: IntoIterator,
    I::Item: AsRef<OsStr>, 
[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.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]