stream_unpack/decompress/mod.rs
1use thiserror::Error;
2
3/// Provides a [Decompressor] for the DEFLATE algorithm using [inflate::InflateStream]
4#[cfg(feature = "deflate")]
5pub mod deflate;
6
7#[derive(Error, Debug)]
8pub enum DecompressionError {
9 #[error("generic decompression error: {0}")]
10 Generic(String)
11}
12
13pub trait Decompressor: std::fmt::Debug {
14 /// Tries to decompress data
15 ///
16 /// The return values are the amount of input bytes decompressed,
17 /// and the result of this decompression operation
18 fn update(&mut self, data: &[u8]) -> Result<(usize, &[u8]), DecompressionError>;
19}