pub struct Error { /* private fields */ }
Expand description

Represents an error encountered during argument parsing

Implementations

Returns an error for a failed attempt at parsing an option value.

Returns an error for a failed attempt at parsing an option’s default value.

Returns an error for a failed attempt at parsing an option value.

Returns an error for an option expecting two or more arguments not receiving the expected number of arguments.

Returns an error for an option receiving an unexpected argument value, e.g. --option=value.

Returns an error for an option expecting two or more argument values receiving only one in the long form, e.g. --option=value.

These options must be passed as, e.g. --option value second-value [...].

Returns an error for a missing required argument.

Returns an error for a missing command name.

Returns an error for a missing required option.

Returns an error for a missing required command.

Returns an error for a missing required free argument.

Returns an error when a free argument was encountered, but the options type does not support free arguments.

Returns an error for an unrecognized command.

Returns an error for an unrecognized option.

Returns an error for an unrecognized long option, e.g. --option.

Returns an error for an unrecognized short option, e.g. -o.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.