Enum prost_types::DurationError
source · #[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 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> 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