Enum parse_duration0::parse::Error
source · [−]pub enum Error {
ParseInt(String),
UnknownUnit(String),
OutOfBounds(i64),
Overflow,
ExpNotSupported,
NoUnitFound(String),
NoValueFound(String),
}
Expand description
An enumeration of the possible errors while parsing.
Variants
ParseInt(String)
UnknownUnit(String)
An unrecognized unit was found.
OutOfBounds(i64)
A i64
was out of range for conversion into a smaller or unsigned type.
Overflow
There was an overflow in the calculation. Usually this happens at 2^63 or 2^64.
ExpNotSupported
Unlike zeta12ti’s original parse_duration, this fork does not support exponential notation in durations.
NoUnitFound(String)
A value without a unit was found.
NoValueFound(String)
No value at all was found.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more