1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! Possible SLIP encoding and decoding errors

/// Type alias for handling SLIP errors.
pub type Result<T> = core::result::Result<T, self::Error>;

/// Errors encountered by SLIP.
#[derive(Debug)]
pub enum Error {
    // Encoder errors
    /// The encoder does not have enough space to write the SLIP header.
    NoOutputSpaceForHeader,
    /// The encoder does not have enough space to write the final SLIP end byte.
    NoOutputSpaceForEndByte,

    // Decoder errors
    /// The decoder cannot process the SLIP header.
    BadHeaderDecode,
    /// The decoder cannot process the SLIP escape sequence.
    BadEscapeSequenceDecode,
}