#[non_exhaustive]pub enum DurationChronoError {
InvalidNanos,
Overflow,
}Available on crate feature
chrono only.Expand description
Errors that can occur when converting a protobuf Duration to a
chrono::TimeDelta.
Distinct from crate::duration_ext::DurationError because TimeDelta’s
representable range (±i64::MAX milliseconds) is narrower than proto
Duration’s, so this conversion has an Overflow failure mode that
std::time::Duration does not.
This enum is #[non_exhaustive] (unlike the older DurationError /
TimestampError, which predate that convention): match arms over it
must include a wildcard arm.
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.
InvalidNanos
The nanos field is outside [-999_999_999, 999_999_999] or its sign
is inconsistent with seconds.
Overflow
The duration exceeds chrono::TimeDelta’s representable range
(±i64::MAX milliseconds).
Trait Implementations§
Source§impl Clone for DurationChronoError
impl Clone for DurationChronoError
Source§fn clone(&self) -> DurationChronoError
fn clone(&self) -> DurationChronoError
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 DurationChronoError
Source§impl Debug for DurationChronoError
impl Debug for DurationChronoError
Source§impl Display for DurationChronoError
impl Display for DurationChronoError
impl Eq for DurationChronoError
Source§impl Error for DurationChronoError
impl Error for DurationChronoError
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 DurationChronoError
impl PartialEq for DurationChronoError
impl StructuralPartialEq for DurationChronoError
Auto Trait Implementations§
impl Freeze for DurationChronoError
impl RefUnwindSafe for DurationChronoError
impl Send for DurationChronoError
impl Sync for DurationChronoError
impl Unpin for DurationChronoError
impl UnsafeUnpin for DurationChronoError
impl UnwindSafe for DurationChronoError
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