use std::fmt;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum Error {
QualityTooLow,
ValueOutOfRange,
OutOfMemory,
BufferTooSmall,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Self::QualityTooLow => "image could not be quantized within the minimum quality",
Self::ValueOutOfRange => "value out of range",
Self::OutOfMemory => "out of memory",
Self::BufferTooSmall => "buffer too small",
})
}
}
impl std::error::Error for Error {}