1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use std::borrow::Cow; use thiserror::Error; pub type ImageResult<T> = Result<T, ImageError>; pub type ImageResultU = Result<(), ImageError>; #[derive(Debug, Error)] pub enum ImageError { #[error("Corrupt image: {0}")] CorruptImage(Cow<'static, str>), #[error("Invalid signature")] InvalidSignature, #[error("IO Error: {0}")] Io(#[from] std::io::Error), #[error("Unsupported format")] Unsupported, }