Struct fisher_common::errors::Error [] [src]

pub struct Error { /* fields omitted */ }

This class represents an error that occured in Fisher.

It contains all the details known about it, and you can either access it programmatically or display the error message to the user, already formatted. It also support automatic conversion from the error types of the libraries Fisher depends on.

Methods

impl Error
[src]

Create a new error. You need to provide the kind of error that occured.

Example

fn my_function() -> Result<()> {
    let error = Error::new(ErrorKind::Dummy);
    Err(error)
}

Set the location where the error occured.

Get the location where the error occured. You can either access it programmatically or print a pretty version of it to the user.

Get the kind of error occured. You can either access it programmatically or print a pretty version of it to the user.

Show a nicely-formatted version of the error, usually for printing it to the user. The function uses ANSI formatting codes.

if let Err(error) = do_work() {
    error.pretty_print();
}

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter.

impl Display for Error
[src]

Formats the value using the given formatter. Read more

impl StdError for Error
[src]

A short description of the error. Read more

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

impl From<ErrorKind> for Error
[src]

Performs the conversion.

impl From<RecvError> for Error
[src]

Performs the conversion.

impl<T> From<SendError<T>> for Error
[src]

Performs the conversion.

impl<T> From<PoisonError<T>> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<Error> for Error
[src]

Performs the conversion.

impl From<AddrParseError> for Error
[src]

Performs the conversion.

impl From<ParseIntError> for Error
[src]

Performs the conversion.

impl From<Box<StdError + Send + Sync>> for Error
[src]

Performs the conversion.