Enum argyle::ArgyleError[][src]

pub enum ArgyleError {
    Custom(&'static str),
    Empty,
    NoArg,
    NoSubCmd,
    Passthru(i32),
    TooManyArgs,
    TooManyKeys,
    WantsDynamicHelp(Option<Box<[u8]>>),
    WantsHelp,
    WantsVersion,
}

Variants

Custom(&'static str)

A custom error.

Empty

Missing anything/everything.

NoArg

No trailing args.

NoSubCmd

Expected subcommand.

Passthru(i32)

Miscellaneous Silent Failure.

This has no corresponding error text, but does have its own exit code.

TooManyArgs

Too many arguments.

TooManyKeys

Too many options defined.

WantsDynamicHelp(Option<Box<[u8]>>)

Wants subcommand help.

WantsHelp

Wants help.

WantsVersion

Wants version.

Implementations

impl ArgyleError[src]

#[must_use]
pub const fn exit_code(&self) -> i32
[src]

Exit code.

This returns the exit code for the error. Non-error errors like help and version have a non-error exit code of 0. ArgyleError::Passthru returns whatever code was defined, while everything else just returns 1.

#[must_use]
pub const fn as_str(&self) -> &'static str
[src]

As Str.

Return as a string slice.

Trait Implementations

impl AsRef<str> for ArgyleError[src]

impl Clone for ArgyleError[src]

impl Debug for ArgyleError[src]

impl Display for ArgyleError[src]

impl Error for ArgyleError[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.