#[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
The kind of error returned by deep-time.
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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DtErrKind
impl StructuralPartialEq for DtErrKind
Source§impl Tsify for DtErrKind
impl Tsify for DtErrKind
const DECL: &'static str = "/**\n * The kind of error returned by deep-time.\n *\n * Almost every function in this crate that can fail returns a\n * [`DtErr`](type.DtErr.html). 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`](struct.AnErr.html). [`DtErr`](type.DtErr.html)\n * is simply `AnErr<DtErrKind, 15>` \u{2014} the whole error is 16 bytes.\n *\n * Create one with the [`an_err!`](macro.an_err!.html) macro, and read the kind\n * back with [`.kind()`](struct.AnErr.html#method.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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.