1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
//! Bayer error codes. use std::io; pub type BayerResult<T> = Result<T, BayerError>; quick_error! { #[derive(Debug)] pub enum BayerError { // Generic failure. Please try to make something more meaningful. NoGood { description("No good") } WrongResolution { description("Wrong resolution") } WrongDepth { description("Wrong depth") } Io(err: io::Error) { from() description(err.description()) display("IO error: {}", err) cause(err) } } }