Skip to main content

Error

Enum Error 

Source
pub enum Error<'args> {
    Uncaught(Uncaught),
    ShortsUnknown {
        shorts: &'args OsStr,
    },
    FlagUnknown {
        flag: &'args OsStr,
    },
    FlagUnexpectedToggle {
        flag: &'args OsStr,
    },
    FlagUnexpectedValue {
        flag: &'args OsStr,
        value: &'args OsStr,
    },
    FlagNoValue {
        flag: &'args OsStr,
    },
    FlagValueNotUtf8 {
        flag: &'args OsStr,
        value: &'args OsStr,
    },
    ParameterUnexpected {
        parameter: &'args OsStr,
    },
    ParameterNotUtf8 {
        parameter: &'args OsStr,
    },
}
Expand description

Enumeration of all possible errors that can be reported by the program argument parser.

Variants§

§

Uncaught(Uncaught)

Uncaught error forwarded from a report.

§

ShortsUnknown

The given short-option flags are unknown and cannot be handled. The flags are provided without the leading dash. Multiple consecutive flags can be reported in a single error.

Fields

§shorts: &'args OsStr
§

FlagUnknown

The given flag is unknown and cannot be handled.

Fields

§flag: &'args OsStr
§

FlagUnexpectedToggle

The given flag is known but was specified with the toggle-prefix no-, which is not valid for this flag.

Fields

§flag: &'args OsStr
§

FlagUnexpectedValue

The given flag is known but was provided an inline value despite not taking any values.

Fields

§flag: &'args OsStr
§value: &'args OsStr
§

FlagNoValue

The given flag is known but was provided no value despite requiring one.

Fields

§flag: &'args OsStr
§

FlagValueNotUtf8

A flag value was specified as invalid UTF-8, despite the flag requiring valid UTF-8 values.

Fields

§flag: &'args OsStr
§value: &'args OsStr
§

ParameterUnexpected

A command parameter was specified but the current command does not take parameters.

Fields

§parameter: &'args OsStr
§

ParameterNotUtf8

A command parameter was specified as invalid UTF-8, despite the given command requiring valid UTF-8 parameters.

Fields

§parameter: &'args OsStr

Trait Implementations§

Source§

impl<'args> Debug for Error<'args>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'args> !RefUnwindSafe for Error<'args>

§

impl<'args> !Send for Error<'args>

§

impl<'args> !Sync for Error<'args>

§

impl<'args> !UnwindSafe for Error<'args>

§

impl<'args> Freeze for Error<'args>

§

impl<'args> Unpin for Error<'args>

§

impl<'args> UnsafeUnpin for Error<'args>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.