use core::fmt;
pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum Error {
Malformed(&'static str),
Unsupported(&'static str),
LimitExceeded(&'static str),
OutputTooSmall,
InvalidState(&'static str),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Malformed(m) => write!(f, "malformed archive: {m}"),
Self::Unsupported(m) => write!(f, "unsupported feature: {m}"),
Self::LimitExceeded(m) => write!(f, "safety limit exceeded: {m}"),
Self::OutputTooSmall => f.write_str("output buffer too small to make progress"),
Self::InvalidState(m) => write!(f, "invalid state: {m}"),
}
}
}
impl core::error::Error for Error {}