#[non_exhaustive]pub enum ParseRatioErr {
Empty,
Overflow,
Numerator(ParseIntError),
Denominator(ParseIntError),
}Expand description
An error which can be returned when parsing a ratio.
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
Value being parsed is empty.
Among other causes, this variant will be constructed when parsing an empty string.
Overflow
Numbers are too large to store together in the fraction field.
Numerator(ParseIntError)
Error when parsing numerator.
Denominator(ParseIntError)
Error when parsing denominator.
This will contain an error kind of Zero if the denominator is 0.
Trait Implementations§
Source§impl Clone for ParseRatioErr
impl Clone for ParseRatioErr
Source§fn clone(&self) -> ParseRatioErr
fn clone(&self) -> ParseRatioErr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParseRatioErr
impl Debug for ParseRatioErr
Source§impl Display for ParseRatioErr
impl Display for ParseRatioErr
Source§impl Error for ParseRatioErr
impl Error for ParseRatioErr
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 ParseRatioErr
impl PartialEq for ParseRatioErr
impl Eq for ParseRatioErr
impl StructuralPartialEq for ParseRatioErr
Auto Trait Implementations§
impl Freeze for ParseRatioErr
impl RefUnwindSafe for ParseRatioErr
impl Send for ParseRatioErr
impl Sync for ParseRatioErr
impl Unpin for ParseRatioErr
impl UnwindSafe for ParseRatioErr
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