weakauras_codec_lib_compress/
error.rs1use core::fmt;
5use std::error;
6
7#[derive(Clone, Debug, PartialEq, Eq)]
9#[non_exhaustive]
10pub enum DecompressionError {
11 InvalidPrefix,
13 InputIsTooSmall,
15 DataExceedsMaxSize,
17 UnexpectedEof,
19 InvalidData,
21}
22
23impl fmt::Display for DecompressionError {
24 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25 match self {
26 Self::InvalidPrefix => write!(f, "Invalid prefix"),
27 Self::InputIsTooSmall => write!(f, "Input is too small"),
28 Self::DataExceedsMaxSize => write!(f, "Compressed data exceeds max size"),
29 Self::UnexpectedEof => write!(f, "Unexpected EOF"),
30 Self::InvalidData => write!(f, "Invalid data"),
31 }
32 }
33}
34
35impl error::Error for DecompressionError {}