//! [`DtErrKind`] and main error type [`DtErr`].
//! [`DtErr`] is a type alias to [`AnErr`].

use crate::AnErr;

#[non_exhaustive]
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DtErrKind {
    UnexpectedEnd,
    TruncatedDirective,
    UnknownItem,
    MissingFeature,
    MissingRefTimeOrStd,
    MustStartWith,
    UnsupportedItem,
    MismatchedLiteral,
    ExpectedUnit,
    ExpectedValue,
    ExpectedYear,
    ExpectedCentury,
    ExpectedMonth,
    ExpectedDay,
    ExpectedDayOfYear,
    ExpectedHour,
    ExpectedMinute,
    ExpectedSecond,
    ExpectedFractional,
    ExpectedTimestamp,
    ExpectedWeekNumber,
    ExpectedWeekdayNumber,
    ExpectedDigits,
    ExpectedMonWeekday,
    ExpectedSunWeekday,
    ExpectedMonWeek,
    ExpectedSunWeek,
    MonWeekdayOutOfRange,
    SunWeekdayOutOfRange,
    InvalidCodeId,
    NonMonotonic,
    TFieldTooShort,
    PFieldTooShort,
    InvalidSubmillisecond,
    InvalidWeekdayName,
    InvalidMonthName,
    InvalidMeridiem,
    InvalidScale,
    InvalidDate,
    InvalidTime,
    InvalidYear,
    InvalidMonth,
    InvalidDay,
    InvalidDayOfYear,
    InvalidIsoWeekYear,
    InvalidIsoWeek,
    InvalidSunWeek,
    InvalidMonWeek,
    InvalidHour,
    InvalidMinute,
    InvalidSecond,
    InvalidFractional,
    InvalidTimestamp,
    InvalidName,
    InvalidTimeZone,
    OffsetMissingSign,
    InvalidOffsetHour,
    InvalidOffsetMinute,
    InvalidOffsetSecond,
    InvalidOffsetColons,
    InvalidOffset,
    InvalidNumber,
    InvalidItem,
    InvalidBytes,
    InvalidSyntax,
    OutOfRange,
    MonthOutOfRange,
    DayOutOfRange,
    DayOfYearOutOfRange,
    HourOutOfRange,
    MinuteOutOfRange,
    SecondOutOfRange,
    WeekOutOfRange,
    IsoWeekOutOfRange,
    YearOutOfRange,
    FracOutOfRange,
    MjdOutOfRange,
    TrailingCharacters,
    Incomplete,
    InvalidInput,
    InvalidLen,
    InternalErr,
    ConversionFail,
    IOErr,
    Empty,
}

/// Wrapper around [`AnErr`].
///
/// A [`DtErr`] object is 16 bytes.
pub type DtErr = AnErr<DtErrKind, 15>;
