#[non_exhaustive]pub enum DurationJiffError {
InvalidNanos,
}Available on crate feature
jiff only.Expand description
Errors that can occur when converting a protobuf Duration to a
jiff::SignedDuration.
Unlike the chrono conversion’s
DurationChronoError, this has no Overflow
mode: a validated nanos (|nanos| < 1_000_000_000) never carries into the
seconds field, and both types store seconds as i64, so every well-formed
proto Duration maps into jiff::SignedDuration in range. The only
failure is a malformed nanos field.
This enum is #[non_exhaustive]: 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.
Trait Implementations§
Source§impl Clone for DurationJiffError
impl Clone for DurationJiffError
Source§fn clone(&self) -> DurationJiffError
fn clone(&self) -> DurationJiffError
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 DurationJiffError
Source§impl Debug for DurationJiffError
impl Debug for DurationJiffError
Source§impl Display for DurationJiffError
impl Display for DurationJiffError
impl Eq for DurationJiffError
Source§impl Error for DurationJiffError
impl Error for DurationJiffError
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 DurationJiffError
impl PartialEq for DurationJiffError
impl StructuralPartialEq for DurationJiffError
Auto Trait Implementations§
impl Freeze for DurationJiffError
impl RefUnwindSafe for DurationJiffError
impl Send for DurationJiffError
impl Sync for DurationJiffError
impl Unpin for DurationJiffError
impl UnsafeUnpin for DurationJiffError
impl UnwindSafe for DurationJiffError
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