Enum termimage::Error [] [src]

pub enum Error {
    GuessingFormatFailed(String),
    OpeningImageFailed(String),
}

Enum representing all possible values the application can fail.

Variants

Failed to guess the image format.

Failed to open image file.

Methods

impl Error
[src]

Get the executable exit value from an Error instance.

Examples

let mut out = Vec::new();
Error::GuessingFormatFailed("not_image.rs".to_string()).print_error(&mut out);
assert_eq!(String::from_iter(out.iter().map(|&i| i as char)),
           "Failed to guess format of \"not_image.rs\".\n".to_string());

Get the executable exit value from an Error instance.

Examples

assert_eq!(Error::GuessingFormatFailed("".to_string()).exit_value(), 1);
assert_eq!(Error::OpeningImageFailed("".to_string()).exit_value(), 2);

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter.

impl Clone for Error
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for Error
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Error
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Error
[src]