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§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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