pub struct CliError {
    pub error: Option<Error>,
    pub exit_code: i32,
}
Expand description

The CLI error is the error type used at Cargo’s CLI-layer.

All errors from the lib side of Cargo will get wrapped with this error. Other errors (such as command-line argument validation) will create this directly.

Fields

error: Option<Error>

The error to display. This can be None in rare cases to exit with a code without displaying a message. For example cargo run -q where the resulting process exits with a nonzero code (on Windows), or an external subcommand that exits nonzero (we assume it printed its own message).

exit_code: i32

The process exit code.

Implementations

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

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.

Should always be Self
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.