Struct arithmetic_eval::arith::CheckedArithmetic  
source · pub struct CheckedArithmetic<Kind = Checked>(/* private fields */);Expand description
Arithmetic on an integer type (e.g., i32) that checks overflow and other failure
conditions for all operations.
As an example, this type implements Arithmetic for all built-in integer types
with a definite size (u8, i8, u16, i16, u32, i32, u64, i64, u128, i128).
The type param defines how negation should be performed; it should be one of Checked
(default value), Unchecked or NegateOnlyZero. See the docs for these types for
more details.
Implementations§
source§impl<Kind> CheckedArithmetic<Kind>
 
impl<Kind> CheckedArithmetic<Kind>
Trait Implementations§
source§impl<T, Kind> Arithmetic<T> for CheckedArithmetic<Kind>where
    T: Clone + PartialEq + Zero + One + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv,
    Kind: CheckedArithmeticKind<T>,
    usize: TryFrom<T>,
 
impl<T, Kind> Arithmetic<T> for CheckedArithmetic<Kind>where
    T: Clone + PartialEq + Zero + One + CheckedAdd + CheckedSub + CheckedMul + CheckedDiv,
    Kind: CheckedArithmeticKind<T>,
    usize: TryFrom<T>,
source§impl<Kind> Clone for CheckedArithmetic<Kind>
 
impl<Kind> Clone for CheckedArithmetic<Kind>
source§impl<Kind: Debug> Debug for CheckedArithmetic<Kind>
 
impl<Kind: Debug> Debug for CheckedArithmetic<Kind>
source§impl<Kind> Default for CheckedArithmetic<Kind>
 
impl<Kind> Default for CheckedArithmetic<Kind>
source§impl<T, Kind> OrdArithmetic<T> for CheckedArithmetic<Kind>where
    Self: Arithmetic<T>,
    T: PartialOrd,
 
impl<T, Kind> OrdArithmetic<T> for CheckedArithmetic<Kind>where
    Self: Arithmetic<T>,
    T: PartialOrd,
impl<Kind> Copy for CheckedArithmetic<Kind>
Auto Trait Implementations§
impl<Kind> Freeze for CheckedArithmetic<Kind>
impl<Kind> RefUnwindSafe for CheckedArithmetic<Kind>where
    Kind: RefUnwindSafe,
impl<Kind> Send for CheckedArithmetic<Kind>where
    Kind: Send,
impl<Kind> Sync for CheckedArithmetic<Kind>where
    Kind: Sync,
impl<Kind> Unpin for CheckedArithmetic<Kind>where
    Kind: Unpin,
impl<Kind> UnwindSafe for CheckedArithmetic<Kind>where
    Kind: UnwindSafe,
Blanket Implementations§
source§impl<T, A> ArithmeticExt<T> for Awhere
    A: Arithmetic<T>,
 
impl<T, A> ArithmeticExt<T> for Awhere
    A: Arithmetic<T>,
source§fn without_comparisons(self) -> FullArithmetic<T, Self>
 
fn without_comparisons(self) -> FullArithmetic<T, Self>
Combines this arithmetic with a comparison function that assumes any two values are
incomparable.
source§fn with_natural_comparison(self) -> FullArithmetic<T, Self>where
    T: PartialOrd,
 
fn with_natural_comparison(self) -> FullArithmetic<T, Self>where
    T: PartialOrd,
Combines this arithmetic with a comparison function specified by the 
PartialOrd
implementation for T.source§fn with_comparison(
    self,
    comparison: fn(_: &T, _: &T) -> Option<Ordering>,
) -> FullArithmetic<T, Self>
 
fn with_comparison( self, comparison: fn(_: &T, _: &T) -> Option<Ordering>, ) -> FullArithmetic<T, Self>
Combines this arithmetic with the specified comparison function.
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: Copy,
 
impl<T> CloneToUninit for Twhere
    T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
 
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)