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 /// %L scale parsing failed
23 InvalidScale,
24 /// Generic must start with
25 MustStartWith,
26 /// Any failure to parse a number, integer, or fractional part
27 /// (no digits, parse::<i64> failed, bad UTF-8, empty fraction, too many decimals, etc.)
28 InvalidNumber,
29 InvalidItem,
30 InvalidBytes,
31 InvalidSyntax,
32
33 FormatterErr,
34 OutOfRange,
35 TrailingCharacters,
36 Incomplete,
37 InvalidInput,
38 CCSDSInputErr,
39 CCSDSOutputErr,
40 InternalErr,
41 IOErr,
42 JiffConversion,
43 ChronoConversion,
44}
45
46// 120 bytes
47pub type DtErr = AnErr<DtErrKind, 2, 49>;