#[non_exhaustive]pub enum ParseUpDurationError {
Empty,
MissingDigits,
InvalidCharacter,
Overflow,
}Expand description
Failure to parse an UpDuration from the grammar ^\d+(ms|h|m|s)?$
#[non_exhaustive], for the same reason as ParseMemSizeError: a
future grammar revision, such as fractional durations or a d/w
unit, would want its own variant rather than folding into
Self::InvalidCharacter’s catch-all.
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.
Empty
The input string was empty
MissingDigits
A unit suffix with no digits before it ("s")
InvalidCharacter
A character outside ASCII digits plus one optional trailing
lowercase h/m/s/ms
Overflow
The duration in milliseconds does not fit in u64
Trait Implementations§
Source§impl Clone for ParseUpDurationError
impl Clone for ParseUpDurationError
Source§fn clone(&self) -> ParseUpDurationError
fn clone(&self) -> ParseUpDurationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParseUpDurationError
Source§impl Debug for ParseUpDurationError
impl Debug for ParseUpDurationError
Source§impl Display for ParseUpDurationError
impl Display for ParseUpDurationError
impl Eq for ParseUpDurationError
Source§impl Error for ParseUpDurationError
impl Error for ParseUpDurationError
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 ParseUpDurationError
impl PartialEq for ParseUpDurationError
impl StructuralPartialEq for ParseUpDurationError
Auto Trait Implementations§
impl Freeze for ParseUpDurationError
impl RefUnwindSafe for ParseUpDurationError
impl Send for ParseUpDurationError
impl Sync for ParseUpDurationError
impl Unpin for ParseUpDurationError
impl UnsafeUnpin for ParseUpDurationError
impl UnwindSafe for ParseUpDurationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.