#[non_exhaustive]pub enum ParseMemSizeError {
Empty,
MissingDigits,
InvalidCharacter,
Overflow,
}Expand description
Failure to parse a MemSize from the grammar ^\d+(G|M|K)?$
#[non_exhaustive]: today’s four variants exhaust one frozen grammar, but
a future revision of it — fractional sizes (1.5G), or a binary-vs-decimal
unit distinction — would want its own variant rather than folding into
Self::InvalidCharacter’s catch-all, and shep-core is a published
library an out-of-tree matcher should not break for the day that lands
(IR-20).
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 ("M")
InvalidCharacter
A character outside ASCII digits plus one optional trailing
G/M/K — covers lowercase units, whitespace, signs, fractions,
and multi-letter suffixes such as "MB"
Overflow
The quantity in bytes does not fit in u64
Trait Implementations§
Source§impl Clone for ParseMemSizeError
impl Clone for ParseMemSizeError
Source§fn clone(&self) -> ParseMemSizeError
fn clone(&self) -> ParseMemSizeError
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 ParseMemSizeError
Source§impl Debug for ParseMemSizeError
impl Debug for ParseMemSizeError
Source§impl Display for ParseMemSizeError
impl Display for ParseMemSizeError
impl Eq for ParseMemSizeError
Source§impl Error for ParseMemSizeError
impl Error for ParseMemSizeError
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 ParseMemSizeError
impl PartialEq for ParseMemSizeError
impl StructuralPartialEq for ParseMemSizeError
Auto Trait Implementations§
impl Freeze for ParseMemSizeError
impl RefUnwindSafe for ParseMemSizeError
impl Send for ParseMemSizeError
impl Sync for ParseMemSizeError
impl Unpin for ParseMemSizeError
impl UnsafeUnpin for ParseMemSizeError
impl UnwindSafe for ParseMemSizeError
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.