[][src]Struct trivial_argument_parser::Argument

pub struct Argument {
    pub arg_result: Option<ArgResult>,
    // some fields omitted
}

Argument struct allows to specify type of expected argument, its names and after parsing contains results.

Examples

use trivial_argument_parser::*;
let mut example_argument = Argument::new(Some('l'), Some("an-list"), ArgType::ValueList).unwrap();

Fields

arg_result: Option<ArgResult>

Implementations

impl Argument[src]

pub fn new(
    short: Option<char>,
    long: Option<&str>,
    arg_type: ArgType
) -> Result<Argument, String>
[src]

Create new Argument. You need to specify at least one name (short or long) or you can specify both. Parameter arg_type changes how the parsing will treat the argument.

pub fn add_value(
    &mut self,
    input_iter: &mut Iter<'_, String>
) -> Result<(), String>
[src]

Trait Implementations

impl Debug for Argument[src]

Auto Trait Implementations

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.