ct_codecs/
error.rs

1use core::fmt::{self, Display};
2
3#[derive(Debug, Copy, Clone, Eq, PartialEq)]
4pub enum Error {
5    /// The provided output buffer would be too small.
6    Overflow,
7    /// The input isn't valid for the given encoding.
8    InvalidInput,
9}
10
11#[cfg(feature = "std")]
12impl std::error::Error for Error {}
13
14impl Display for Error {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match self {
17            Error::Overflow => write!(f, "Overflow"),
18            Error::InvalidInput => write!(f, "Invalid input"),
19        }
20    }
21}