#[non_exhaustive]pub enum TemporalValueError {
InvalidMonth(u8),
InvalidDay {
year: i32,
month: u8,
day: u8,
},
InvalidHour(u8),
InvalidMinute(u8),
InvalidSecond(u8),
InvalidNanosecond(u32),
InvalidOffsetSeconds(i32),
InvalidFormat,
MissingOffset,
UnexpectedOffset,
OutOfRange,
}Expand description
Validation and parsing errors for TemporalValue and DateTimeValue.
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.
InvalidMonth(u8)
The provided month was outside 1..=12.
InvalidDay
The provided day was invalid for the given month and year.
InvalidHour(u8)
The provided hour was outside 0..=23.
InvalidMinute(u8)
The provided minute was outside 0..=59.
InvalidSecond(u8)
The provided second was outside 0..=59.
InvalidNanosecond(u32)
The provided nanosecond value was outside 0..1_000_000_000.
InvalidOffsetSeconds(i32)
The provided UTC offset was outside the supported range.
InvalidFormat
A string could not be parsed as a canonical datetime value.
MissingOffset
A conversion required an offset-aware datetime, but none was present.
UnexpectedOffset
A conversion required a naive datetime, but an offset was present.
OutOfRange
A temporal value could not be represented by the requested target type.
Trait Implementations§
Source§impl Clone for TemporalValueError
impl Clone for TemporalValueError
Source§fn clone(&self) -> TemporalValueError
fn clone(&self) -> TemporalValueError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemporalValueError
impl Debug for TemporalValueError
Source§impl Display for TemporalValueError
impl Display for TemporalValueError
Source§impl Error for TemporalValueError
impl Error for TemporalValueError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for TemporalValueError
impl PartialEq for TemporalValueError
impl Eq for TemporalValueError
impl StructuralPartialEq for TemporalValueError
Auto Trait Implementations§
impl Freeze for TemporalValueError
impl RefUnwindSafe for TemporalValueError
impl Send for TemporalValueError
impl Sync for TemporalValueError
impl Unpin for TemporalValueError
impl UnsafeUnpin for TemporalValueError
impl UnwindSafe for TemporalValueError
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.