deep_time/error.rs
1use crate::AnErr;
2
3#[non_exhaustive]
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum DtErrKind {
6 /// Format string or input ended unexpectedly (%, ., exhausted input, etc.)
7 UnexpectedEnd,
8 /// Unknown % directive (the `_` case)
9 UnknownDirective,
10 /// %c, %r, %X, %x, %Z etc. (explicitly unsupported library directives)
11 UnsupportedDirective,
12 /// The `.` was followed by something other than f/N
13 BadFractional,
14 /// Literal character or % sign in input didn't match format
15 MismatchedLiteral,
16 /// Generic "could not parse expected integer" (year, month, day, hour, …)
17 ExpectedValue,
18 /// Month name, weekday name, or AM/PM failed to parse
19 InvalidName,
20 /// Anything wrong with a timezone offset (+HH:MM:SS syntax)
21 InvalidTimezoneOffset,
22 MustStartWith,
23 InvalidNumber,
24 InvalidItem,
25 InvalidBytes,
26 InvalidSyntax,
27 OutOfRange,
28 TrailingCharacters,
29 Incomplete,
30 InvalidInput,
31 InternalErr,
32 IOErr,
33}
34
35// 120 bytes
36pub type DtErr = AnErr<DtErrKind, 2, 49>;