use core::fmt;
pub type Result<T> = core::result::Result<T, self::Error>;
#[derive(Debug)]
pub enum Error {
NoOutputSpaceForHeader,
NoOutputSpaceForEndByte,
BadHeaderDecode,
BadEscapeSequenceDecode,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
Error::NoOutputSpaceForHeader => "insufficient space in output buffer for header",
Error::NoOutputSpaceForEndByte => "insufficient space in output buffer for end byte",
Error::BadHeaderDecode => "malformed header",
Error::BadEscapeSequenceDecode => "malformed escape sequence",
})
}
}