Skip to main content

qpack/
lib.rs

1pub use self::{
2    decoder::{Decoded, DecoderError, decode_stateless},
3    encoder::{EncoderError, encode_stateless},
4    field::HeaderField,
5};
6
7#[cfg(feature = "http-headers")]
8pub mod http_headers;
9
10mod block;
11mod dynamic;
12mod field;
13mod parse_error;
14mod static_;
15mod stream;
16mod vas;
17
18mod decoder;
19mod encoder;
20
21mod prefix_int;
22mod prefix_string;
23
24#[cfg(test)]
25mod tests;
26
27#[derive(Debug)]
28pub enum Error {
29    Encoder(EncoderError),
30    Decoder(DecoderError),
31}
32
33impl std::error::Error for Error {}
34
35impl std::fmt::Display for Error {
36    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37        match self {
38            Error::Encoder(e) => write!(f, "Encoder {}", e),
39            Error::Decoder(e) => write!(f, "Decoder {}", e),
40        }
41    }
42}