#[non_exhaustive]pub enum TimestampError {
OutOfRange,
Deserialize(Box<dyn Error + Send + Sync>),
}Expand description
Represent failures in converting or creating Timestamp instances.
Examples
let ts = Timestamp::new(Timestamp::MAX_SECONDS + 2, 0);
assert!(matches!(ts, Err(TimestampError::OutOfRange)));
let ts = Timestamp::new(0, 1_500_000_000);
assert!(matches!(ts, Err(TimestampError::OutOfRange)));
let ts = Timestamp::try_from("invalid");
assert!(matches!(ts, Err(TimestampError::Deserialize(_))));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.
OutOfRange
One of the components (seconds and/or nanoseconds) was out of range.
Deserialize(Box<dyn Error + Send + Sync>)
There was a problem deserializing a timestamp.
Trait Implementations§
Source§impl Debug for TimestampError
impl Debug for TimestampError
Source§impl Display for TimestampError
impl Display for TimestampError
Source§impl Error for TimestampError
impl Error for TimestampError
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()
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