Enum termimage::Error
[−]
[src]
pub enum Error { GuessingFormatFailed(String), OpeningImageFailed(String), }
Enum representing all possible values the application can fail.
Variants
GuessingFormatFailed(String)
Failed to guess the image format.
OpeningImageFailed(String)
Failed to open image file.
Methods
impl Error
[src]
fn print_error<W: Write>(&self, err_out: &mut W)
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());
fn exit_value(&self) -> i32
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]
impl Clone for Error
[src]
fn clone(&self) -> Error
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Hash for Error
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
This method tests for !=
.