#[non_exhaustive]#[repr(u8)]pub enum DtErrKind {
Show 85 variants
UnexpectedEnd = 0,
TruncatedDirective = 1,
UnknownItem = 2,
MissingFeature = 3,
MissingRefTimeOrStd = 4,
MustStartWith = 5,
UnsupportedItem = 6,
MismatchedLiteral = 7,
ExpectedUnit = 8,
ExpectedValue = 9,
ExpectedYear = 10,
ExpectedCentury = 11,
ExpectedMonth = 12,
ExpectedDay = 13,
ExpectedDayOfYear = 14,
ExpectedHour = 15,
ExpectedMinute = 16,
ExpectedSecond = 17,
ExpectedFractional = 18,
ExpectedTimestamp = 19,
ExpectedWeekNumber = 20,
ExpectedWeekdayNumber = 21,
ExpectedDigits = 22,
ExpectedMonWeekday = 23,
ExpectedSunWeekday = 24,
ExpectedMonWeek = 25,
ExpectedSunWeek = 26,
MonWeekdayOutOfRange = 27,
SunWeekdayOutOfRange = 28,
InvalidCodeId = 29,
NonMonotonic = 30,
TFieldTooShort = 31,
PFieldTooShort = 32,
InvalidSubmillisecond = 33,
InvalidWeekdayName = 34,
InvalidMonthName = 35,
InvalidMeridiem = 36,
InvalidScale = 37,
InvalidDate = 38,
InvalidTime = 39,
InvalidYear = 40,
InvalidMonth = 41,
InvalidDay = 42,
InvalidDayOfYear = 43,
InvalidIsoWeekYear = 44,
InvalidIsoWeek = 45,
InvalidSunWeek = 46,
InvalidMonWeek = 47,
InvalidHour = 48,
InvalidMinute = 49,
InvalidSecond = 50,
InvalidFractional = 51,
InvalidTimestamp = 52,
InvalidName = 53,
InvalidTimeZone = 54,
OffsetMissingSign = 55,
InvalidOffsetHour = 56,
InvalidOffsetMinute = 57,
InvalidOffsetSecond = 58,
InvalidOffsetColons = 59,
InvalidOffset = 60,
InvalidNumber = 61,
InvalidItem = 62,
InvalidBytes = 63,
InvalidSyntax = 64,
OutOfRange = 65,
MonthOutOfRange = 66,
DayOutOfRange = 67,
DayOfYearOutOfRange = 68,
HourOutOfRange = 69,
MinuteOutOfRange = 70,
SecondOutOfRange = 71,
WeekOutOfRange = 72,
IsoWeekOutOfRange = 73,
YearOutOfRange = 74,
FracOutOfRange = 75,
MjdOutOfRange = 76,
TrailingCharacters = 77,
Incomplete = 78,
InvalidInput = 79,
InvalidLen = 80,
InternalErr = 81,
ConversionFail = 82,
IOErr = 83,
Empty = 84,
}Expand description
Failure category inside DtErr — parse errors, out-of-range
values, missing features, and similar cases.
Almost every function in this crate that can fail returns a
DtErr. That error is made of two parts:
- A kind — one of the variants of this enum (what went wrong).
- A short reason string — optional extra detail (up to 15 bytes).
Those two pieces live inside AnErr. DtErr
is simply AnErr<DtErrKind, 15> — the whole error is 16 bytes.
Create one with the an_err! macro, and read the kind
back with .kind():
use deep_time::{DtErr, DtErrKind, an_err};
let err: DtErr = an_err!(DtErrKind::YearOutOfRange, "year={}", 10_000);
assert_eq!(err.kind(), DtErrKind::YearOutOfRange);When printed, an error looks like YearOutOfRange or
YearOutOfRange: year=10000.
This enum is marked #[non_exhaustive], so new variants may be added in
later releases. Always keep a catch-all arm (_ => ...) when matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEnd = 0
Input ended before a complete token or value was parsed.
TruncatedDirective = 1
A format % directive was cut off before its letter.
UnknownItem = 2
Unrecognized format directive or parse item.
MissingFeature = 3
Required Cargo feature is not enabled.
MissingRefTimeOrStd = 4
A reference time or the std feature is required for this operation.
MustStartWith = 5
Input must begin with a specific prefix or pattern.
UnsupportedItem = 6
Format item or value type is not supported in this context.
MismatchedLiteral = 7
A required literal character in the format did not match input.
ExpectedUnit = 8
Expected a duration unit (e.g. s, ms, day).
ExpectedValue = 9
Expected a numeric value.
ExpectedYear = 10
Expected a year field.
ExpectedCentury = 11
Expected a century field.
ExpectedMonth = 12
Expected a month field.
ExpectedDay = 13
Expected a day-of-month field.
ExpectedDayOfYear = 14
Expected a day-of-year field.
ExpectedHour = 15
Expected an hour field.
ExpectedMinute = 16
Expected a minute field.
ExpectedSecond = 17
Expected a second field.
ExpectedFractional = 18
Expected a fractional-seconds field.
ExpectedTimestamp = 19
Expected a Unix or epoch timestamp field.
ExpectedWeekNumber = 20
Expected a week-number field.
ExpectedWeekdayNumber = 21
Expected a weekday-number field.
ExpectedDigits = 22
Expected one or more decimal digits.
ExpectedMonWeekday = 23
Expected a Monday-based weekday number.
ExpectedSunWeekday = 24
Expected a Sunday-based weekday number.
ExpectedMonWeek = 25
Expected a Monday-based week number.
ExpectedSunWeek = 26
Expected a Sunday-based week number.
MonWeekdayOutOfRange = 27
Monday-based weekday number is outside 1–7.
SunWeekdayOutOfRange = 28
Sunday-based weekday number is outside 0–6 (or 1–7).
InvalidCodeId = 29
Invalid binary/wire code or format identifier.
NonMonotonic = 30
Sequence is not strictly increasing (e.g. leap-second table).
TFieldTooShort = 31
CCSDS or binary T-field is shorter than required.
PFieldTooShort = 32
CCSDS or binary P-field is shorter than required.
InvalidSubmillisecond = 33
Sub-millisecond fractional part is invalid.
InvalidWeekdayName = 34
Weekday name could not be recognized.
InvalidMonthName = 35
Month name could not be recognized.
InvalidMeridiem = 36
AM/PM (meridiem) indicator is invalid.
InvalidScale = 37
Time scale name or code is invalid.
InvalidDate = 38
Calendar date is not a valid civil date.
InvalidTime = 39
Time-of-day is not a valid civil time.
InvalidYear = 40
Year value is invalid for the operation.
InvalidMonth = 41
Month value is invalid (not 1–12, or unusable in context).
InvalidDay = 42
Day-of-month is invalid for the given month/year.
InvalidDayOfYear = 43
Day-of-year is invalid (not 1–365/366).
InvalidIsoWeekYear = 44
ISO week-year is invalid.
InvalidIsoWeek = 45
ISO week number is invalid.
InvalidSunWeek = 46
Sunday-based week number is invalid.
InvalidMonWeek = 47
Monday-based week number is invalid.
InvalidHour = 48
Hour is invalid for the civil time representation.
InvalidMinute = 49
Minute is invalid (typically not 0–59).
InvalidSecond = 50
Second is invalid (including leap-second rules where applicable).
InvalidFractional = 51
Fractional seconds field is invalid.
InvalidTimestamp = 52
Timestamp value is invalid or could not be interpreted.
InvalidName = 53
Name (e.g. language or locale) is invalid.
InvalidTimeZone = 54
Time zone identifier could not be resolved.
OffsetMissingSign = 55
UTC offset is missing a required + or - sign.
InvalidOffsetHour = 56
Hour component of a UTC offset is invalid.
InvalidOffsetMinute = 57
Minute component of a UTC offset is invalid.
InvalidOffsetSecond = 58
Second component of a UTC offset is invalid.
InvalidOffsetColons = 59
UTC offset colon separators are malformed.
InvalidOffset = 60
UTC offset string or value is invalid overall.
InvalidNumber = 61
Numeric token could not be parsed.
InvalidItem = 62
Format or parse item is invalid in this context.
InvalidBytes = 63
Byte sequence is not valid for the expected encoding.
InvalidSyntax = 64
Input syntax is invalid.
OutOfRange = 65
A value lies outside the allowed range for this operation.
MonthOutOfRange = 66
Month is outside the valid range.
DayOutOfRange = 67
Day is outside the valid range.
DayOfYearOutOfRange = 68
Day-of-year is outside the valid range.
HourOutOfRange = 69
Hour is outside the valid range.
MinuteOutOfRange = 70
Minute is outside the valid range.
SecondOutOfRange = 71
Second is outside the valid range.
WeekOutOfRange = 72
Week number is outside the valid range.
IsoWeekOutOfRange = 73
ISO week number is outside the valid range.
YearOutOfRange = 74
Year is outside the valid range.
FracOutOfRange = 75
Fractional part is outside the valid range.
MjdOutOfRange = 76
Modified Julian Date is outside the valid range.
TrailingCharacters = 77
Input has unexpected characters after a complete value.
Incomplete = 78
Parse or conversion stopped before a complete value was formed.
InvalidInput = 79
Input is invalid for a reason not covered by a more specific kind.
InvalidLen = 80
Buffer or field length is invalid.
InternalErr = 81
Internal invariant failed (should not occur in normal use).
ConversionFail = 82
Conversion between representations or crates failed.
IOErr = 83
I/O error while reading or writing data (e.g. EOP file).
Empty = 84
Input is empty where a value was required.
Trait Implementations§
impl Copy for DtErrKind
Source§impl<'de> Deserialize<'de> for DtErrKind
impl<'de> Deserialize<'de> for DtErrKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DtErrKind
impl StructuralPartialEq for DtErrKind
Source§impl Tsify for DtErrKind
impl Tsify for DtErrKind
const DECL: &'static str = "/**\n * Failure category inside [`DtErr`](crate::DtErr) \u{2014} parse errors, out-of-range\n * values, missing features, and similar cases.\n *\n * Almost every function in this crate that can fail returns a\n * [`DtErr`](crate::DtErr). That error is made of two parts:\n *\n * 1. A **kind** \u{2014} one of the variants of this enum (what went wrong).\n * 2. A short **reason** string \u{2014} optional extra detail (up to 15 bytes).\n *\n * Those two pieces live inside [`AnErr`](crate::AnErr). [`DtErr`](crate::DtErr)\n * is simply `AnErr<DtErrKind, 15>` \u{2014} the whole error is 16 bytes.\n *\n * Create one with the [`an_err!`](crate::an_err) macro, and read the kind\n * back with [`.kind()`](crate::AnErr::kind):\n *\n * ```\n * use deep_time::{DtErr, DtErrKind, an_err};\n *\n * let err: DtErr = an_err!(DtErrKind::YearOutOfRange, \\\"year={}\\\", 10_000);\n * assert_eq!(err.kind(), DtErrKind::YearOutOfRange);\n * ```\n *\n * When printed, an error looks like `YearOutOfRange` or\n * `YearOutOfRange: year=10000`.\n *\n * This enum is marked `#[non_exhaustive]`, so new variants may be added in\n * later releases. Always keep a catch-all arm (`_ => ...`) when matching.\n */\nexport type 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\";"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Auto Trait Implementations§
impl Freeze for DtErrKind
impl RefUnwindSafe for DtErrKind
impl Send for DtErrKind
impl Sync for DtErrKind
impl Unpin for DtErrKind
impl UnsafeUnpin for DtErrKind
impl UnwindSafe for DtErrKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.