#[non_exhaustive]pub enum DurationError {
ParseFailure,
NegativeDuration(Duration),
OutOfRange,
}
Expand description
A duration handling error.
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.
ParseFailure
Indicates failure to parse a Duration
from a string.
The Duration
string format is specified in the Protobuf JSON mapping specification.
NegativeDuration(Duration)
Indicates failure to convert a prost_types::Duration
to a std::time::Duration
because
the duration is negative. The included std::time::Duration
matches the magnitude of the
original negative prost_types::Duration
.
OutOfRange
Indicates failure to convert a std::time::Duration
to a prost_types::Duration
.
Converting a std::time::Duration
to a prost_types::Duration
fails if the magnitude
exceeds that representable by prost_types::Duration
.
Trait Implementations§
Source§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 From<DurationError> for CelConversionError
Available on crate feature cel
only.
impl From<DurationError> for CelConversionError
Available on crate feature
cel
only.Source§fn from(source: DurationError) -> Self
fn from(source: DurationError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DurationError
impl PartialEq 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 UnwindSafe for DurationError
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T
behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T
behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Rc
pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Arc
pointerSource§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