devela/media/image/sixel/
error.rs
1use devela::Error;
4
5pub(crate) type SixelResult<T> = Result<T, SixelError>;
7
8#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
10pub enum SixelError {
11 BadArgument,
13 BadInput,
15 BadIntegerOverflow,
17}
18
19mod _core_impls {
20 use super::{Error, SixelError};
21 use core::fmt;
22
23 impl Error for SixelError {}
24
25 impl fmt::Display for SixelError {
26 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27 match self {
28 SixelError::BadArgument => write!(f, "bad argument detected"),
29 SixelError::BadInput => write!(f, "bad input detected"),
30 SixelError::BadIntegerOverflow => write!(f, "integer overflow"),
31 }
32 }
33 }
34}