pub enum DurationError {
NegativeDuration,
InvalidNanos,
}Expand description
Errors that can occur when converting a protobuf Duration to a Rust type.
Variants§
NegativeDuration
The duration is negative and cannot be represented as std::time::Duration.
InvalidNanos
The nanos field is outside its valid range, or its sign is inconsistent
with the seconds field.
Per the protobuf spec, nanos must be in [-999_999_999, 999_999_999]
and must have the same sign (or be zero) as seconds.
Trait Implementations§
Source§impl Clone for DurationError
impl Clone for DurationError
Source§fn clone(&self) -> DurationError
fn clone(&self) -> DurationError
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 DurationError
impl Debug for DurationError
Source§impl Display for DurationError
impl Display for DurationError
Source§impl Error for DurationError
impl Error for DurationError
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 DurationError
impl PartialEq for DurationError
impl Copy for DurationError
impl Eq for DurationError
impl StructuralPartialEq for DurationError
Auto Trait Implementations§
impl Freeze for DurationError
impl RefUnwindSafe for DurationError
impl Send for DurationError
impl Sync for DurationError
impl Unpin for DurationError
impl UnsafeUnpin for DurationError
impl UnwindSafe for DurationError
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