deep_time/error.rs
1//! [`DtErrKind`] and main error type [`DtErr`].
2//!
3//! [`DtErr`] is a type alias to [`AnErr`] — a compact,
4//! zero-allocation error that supports chaining with
5//! source locations and short per-level reasons.
6
7use crate::AnErr;
8
9#[non_exhaustive]
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11pub enum DtErrKind {
12 UnexpectedEnd,
13 UnknownItem,
14 UnsupportedItem,
15 BadFractional,
16 MismatchedLiteral,
17 ExpectedValue,
18 InvalidName,
19 InvalidTimezoneOffset,
20 MustStartWith,
21 InvalidNumber,
22 InvalidItem,
23 InvalidBytes,
24 InvalidSyntax,
25 OutOfRange,
26 TrailingCharacters,
27 Incomplete,
28 InvalidInput,
29 InternalErr,
30 IOErr,
31}
32
33// 120 bytes
34pub type DtErr = AnErr<DtErrKind, 2, 49>;