[][src]Struct simpleargs::Value

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

A handle for getting the value associated with a named flag.UsageError

This handle can only be used once, and is consumed.

Methods

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

pub fn as_str(self) -> Result<&'a str, OptionError>[src]

Get the associated value as a string.

Note that ownership of the string is not passed. Ownership is kept by the NamedArgument so it can be attached to error messages.

Returns an error if the user did not supply a value.

pub fn as_osstr(self) -> Result<&'a OsStr, OptionError>[src]

Get the associated value as an OsStr.

Note that ownership of the string is not passed. Ownership is kept by the NamedArgument so it can be attached to error messages.

Returns an error if the user did not supply a value.

Auto Trait Implementations

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

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

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

impl<'a, T> Unpin for Value<'a, T>

impl<'a, T> !UnwindSafe for Value<'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.