Enum parkour::ErrorInner[][src]

pub enum ErrorInner {
    NoValue,
    MissingValue,
    IncompleteValue(usize),
    EarlyExit,
    InArgument(String),
    InSubcommand(String),
    UnexpectedValue {
        got: String,
        expected: String,
    },
    TooManyValues {
        max: usize,
        count: usize,
    },
    WrongNumberOfValues {
        expected: usize,
        got: usize,
    },
    MissingArgument {
        arg: String,
    },
    UnexpectedArgument {
        arg: String,
    },
    TooManyArgOccurrences {
        arg: String,
        max: Option<u32>,
    },
    ParseIntError(ParseIntError),
    ParseFloatError(ParseFloatError),
}

The error type when parsing command-line arguments

Variants

NoValue

The argument you tried to parse wasn't present at the current position. Has a similar purpose as Option::None

MissingValue

The argument you tried to parse wasn't present at the current position, but was required

IncompleteValue(usize)

The argument you tried to parse was only partly present

EarlyExit

Used when an argument should abort argument parsing, like --help

InArgument(String)

Indicates that the error originated in the specified argument. This should be used as the source for another error

InSubcommand(String)

Indicates that the error originated in the specified subcommand. This should be used as the source for another error

UnexpectedValue

The parsed value doesn't meet our expectations

Fields of UnexpectedValue

got: String

The value we tried to parse

expected: String

The expectation that was violated. For example, this string can contain a list of accepted values.

TooManyValues

The parsed list contains more items than allowed

Fields of TooManyValues

max: usize

The maximum number of items

count: usize

The number of items that was parsed

WrongNumberOfValues

The parsed array has the wrong length

Fields of WrongNumberOfValues

expected: usize

The length of the array

got: usize

The number of items that was parsed

MissingArgument

A required argument was not provided

Fields of MissingArgument

arg: String

The name of the argument that is missing

UnexpectedArgument

An unknown argument was provided

Fields of UnexpectedArgument

arg: String

The (full) argument that wasn't expected

TooManyArgOccurrences

An argument was provided more often than allowed

Fields of TooManyArgOccurrences

arg: String

The name of the argument that was provided too many times

max: Option<u32>

The maximum number of times the argument may be provided

ParseIntError(ParseIntError)

Parsing an integer failed

ParseFloatError(ParseFloatError)

Parsing a floating-point number failed

Trait Implementations

impl Debug for ErrorInner[src]

impl From<ErrorInner> for Error[src]

impl PartialEq<ErrorInner> for ErrorInner[src]

impl StructuralPartialEq for ErrorInner[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.