pub enum RationalError {
ZeroDenominator,
DivisionByZero,
NormalizationOverflow,
ArithmeticOverflow {
operation: &'static str,
},
}Expand description
Errors returned by validated rational-number helpers.
Variants§
ZeroDenominator
A rational denominator must not be zero.
DivisionByZero
Division by a zero-valued rational is undefined.
NormalizationOverflow
Sign normalization could not be represented in the current integer type.
ArithmeticOverflow
Exact arithmetic overflowed the current integer representation.
Trait Implementations§
Source§impl Clone for RationalError
impl Clone for RationalError
Source§fn clone(&self) -> RationalError
fn clone(&self) -> RationalError
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 RationalError
impl Debug for RationalError
Source§impl Display for RationalError
impl Display for RationalError
Source§impl Error for RationalError
impl Error for RationalError
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 RationalError
impl PartialEq for RationalError
impl Copy for RationalError
impl Eq for RationalError
impl StructuralPartialEq for RationalError
Auto Trait Implementations§
impl Freeze for RationalError
impl RefUnwindSafe for RationalError
impl Send for RationalError
impl Sync for RationalError
impl Unpin for RationalError
impl UnsafeUnpin for RationalError
impl UnwindSafe for RationalError
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