#[non_exhaustive]pub enum Error<const P: Precision> {
ConversionError(TryFromIntError),
OutOfRangeUnits,
OutOfRangeFrac,
ParserError(ParseIntError),
}Expand description
An error type covering the cases where units or fractional values are out of range, when a conversion error happens (ie. trying to convert from a negative or too big value), or when parsing fails.
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.
ConversionError(TryFromIntError)
Failed to convert an integer type into a FixedP.
OutOfRangeUnits
Units are too big.
OutOfRangeFrac
Fractional part is too big, ie. over the given scale.
ParserError(ParseIntError)
Error parsing a fixed point value. This usually boils down to very
big integers or fractions, or non-digit characters in the string
other than the single . separator occurrence between integers
and fractions.
Trait Implementations§
Source§impl<const P: Precision> Error for Error<P>
impl<const P: Precision> Error for Error<P>
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<const P: Precision> From<Infallible> for Error<P>
impl<const P: Precision> From<Infallible> for Error<P>
Source§fn from(i: Infallible) -> Self
fn from(i: Infallible) -> Self
Converts to this type from the input type.
Source§impl<const P: Precision> From<ParseIntError> for Error<P>
impl<const P: Precision> From<ParseIntError> for Error<P>
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl<const P: Precision> From<TryFromIntError> for Error<P>
impl<const P: Precision> From<TryFromIntError> for Error<P>
Source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Converts to this type from the input type.
impl<const P: Precision> Eq for Error<P>
impl<const P: Precision> StructuralPartialEq for Error<P>
Auto Trait Implementations§
impl<const P: u8> Freeze for Error<P>
impl<const P: u8> RefUnwindSafe for Error<P>
impl<const P: u8> Send for Error<P>
impl<const P: u8> Sync for Error<P>
impl<const P: u8> Unpin for Error<P>
impl<const P: u8> UnwindSafe for Error<P>
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