httlib_huffman/decoder/
error.rs

1use std::error;
2use std::fmt;
3
4/// Contains error options that can be encountered while performing the decoding
5/// operations.
6#[derive(Debug, PartialEq)]
7pub enum DecoderError {
8    /// Indicates that the decoder received an invalid Huffman code. This should
9    /// never happen in the input is encoded according to the HPACK spec.
10    InvalidInput,
11}
12
13impl fmt::Display for DecoderError {
14    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
15        match self {
16            Self::InvalidInput => write!(fmt, "Invalid Huffman sequence."),
17        }
18    }
19}
20
21impl error::Error for DecoderError {}