#[non_exhaustive]pub enum TimestampError {
NanosOutOfRange {
nanos: u64,
max_nanos: u64,
},
MillisOutOfRange {
millis: u64,
},
InstantOutOfRange {
seconds: i64,
},
}Expand description
Rejection reasons for crate::types::Timestamp construction.
A Timestamp counts nanoseconds since the Unix epoch as an unsigned value
bounded by crate::types::Timestamp::MAX_NANOS, so instants before
1970-01-01 and after 2262-04-11 are not representable.
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.
NanosOutOfRange
The nanosecond count exceeds the representable range.
Fields
MillisOutOfRange
The millisecond count overflows when scaled to nanoseconds.
InstantOutOfRange
A calendar instant falls outside the representable range — before the Unix epoch, or past the nanosecond ceiling.
Trait Implementations§
Source§impl Clone for TimestampError
impl Clone for TimestampError
Source§fn clone(&self) -> TimestampError
fn clone(&self) -> TimestampError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TimestampError
Source§impl Debug for TimestampError
impl Debug for TimestampError
Source§impl Display for TimestampError
impl Display for TimestampError
impl Eq for TimestampError
Source§impl Error for TimestampError
impl Error for TimestampError
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 TimestampError
impl PartialEq for TimestampError
impl StructuralPartialEq for TimestampError
Auto Trait Implementations§
impl Freeze for TimestampError
impl RefUnwindSafe for TimestampError
impl Send for TimestampError
impl Sync for TimestampError
impl Unpin for TimestampError
impl UnsafeUnpin for TimestampError
impl UnwindSafe for TimestampError
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