[][src]Struct simpleargs::NamedArgument

pub struct NamedArgument<'a, T> where
    T: Iterator
{ /* fields omitted */ }

A named command-line argument which may or may not have an associated value.

Methods

impl<'a, T> NamedArgument<'a, T> where
    T: Iterator,
    <T as Iterator>::Item: ArgString
[src]

pub fn parse<U, F>(self, f: F) -> Result<U, UsageError<<T as Iterator>::Item>> where
    F: FnOnce(&'b str, Value<'b, T>) -> Result<U, OptionError>, 
[src]

Parse the named command-line option.

The option name and value are passed to the supplied function. Any errors that the function returns are annotated with information about the option.

An error is returned if the user supplied a value, but as_str or as_osstr is not called.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for NamedArgument<'a, T> where
    T: RefUnwindSafe,
    <T as Iterator>::Item: RefUnwindSafe

impl<'a, T> Send for NamedArgument<'a, T> where
    T: Send,
    <T as Iterator>::Item: Send

impl<'a, T> Sync for NamedArgument<'a, T> where
    T: Sync,
    <T as Iterator>::Item: Sync

impl<'a, T> Unpin for NamedArgument<'a, T> where
    <T as Iterator>::Item: Unpin

impl<'a, T> !UnwindSafe for NamedArgument<'a, T>

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.