httlib_huffman/encoder/
error.rs

1use std::error;
2use std::fmt;
3
4/// Contains error options that can be encountered while performing the encoding
5/// operations.
6#[derive(Debug, PartialEq)]
7pub enum EncoderError {
8    /// Indicates that the encoder received an invalid ASCII character. Note
9    /// that only ASCII characters provided in the HPACK spec should be used.
10    InvalidInput,
11}
12
13impl fmt::Display for EncoderError {
14    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
15        match self {
16            Self::InvalidInput => write!(fmt, "Invalid input character."),
17        }
18    }
19}
20
21impl error::Error for EncoderError {}