1#![cfg_attr(feature = "fast", feature(portable_simd))]
2
3mod fast;
10mod filters;
11mod huffman;
12mod ppmd;
13pub mod rar13;
14pub mod rar20;
15pub mod rar29;
16pub mod rar50;
17pub mod rarvm;
18
19pub type Result<T> = std::result::Result<T, Error>;
20
21#[derive(Debug, Clone, PartialEq, Eq)]
22#[non_exhaustive]
23pub enum Error {
24 InvalidData(&'static str),
25 NeedMoreInput,
26}
27
28impl std::fmt::Display for Error {
29 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30 match self {
31 Self::InvalidData(msg) => write!(f, "{msg}"),
32 Self::NeedMoreInput => write!(f, "codec input is truncated"),
33 }
34 }
35}
36
37impl std::error::Error for Error {}