json_deserializer/
error.rs

1use core::fmt::Display;
2
3/// List of possible errors
4#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5pub enum Error {
6    /// todo
7    NumberWithTwoPeriods,
8    /// todo
9    InvalidUtf8,
10    /// todo
11    InvalidEscaped(u8),
12    /// todo
13    InvalidHex(u8),
14    /// Invalid surrogate
15    InvalidLoneLeadingSurrogateInHexEscape(u16),
16    /// Invalid surrogate pair
17    InvalidSurrogateInHexEscape(u16),
18    /// When a surrogate misses the pair
19    UnexpectedEndOfHexEscape,
20    /// todo
21    KeyWithoutDoubleColon,
22    /// todo
23    InvalidToken(u8),
24    /// todo
25    MissingComma(u8),
26    /// todo
27    InvalidStringToken(u8),
28    /// todo
29    InvalidNullToken([u8; 4]),
30    /// When an invalid token is found while trying to parse "false"
31    InvalidFalseToken([u8; 5]),
32    /// When an invalid token is found while trying to parse "true"
33    InvalidTrueToken([u8; 4]),
34    /// todo
35    InvalidEOF,
36}
37
38impl Display for Error {
39    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
40        write!(f, "{:?}", self)
41    }
42}