Struct arithmetic_eval::arith::WrappingArithmetic
source · pub struct WrappingArithmetic;
Expand description
Arithmetic on an integer type (e.g., i32
), in which all operations have wrapping semantics.
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
).
Trait Implementations§
source§impl<T> Arithmetic<T> for WrappingArithmeticwhere
T: Copy + PartialEq + Zero + One + WrappingAdd + WrappingSub + WrappingMul + WrappingNeg + Div<T, Output = T>,
usize: TryFrom<T>,
impl<T> Arithmetic<T> for WrappingArithmeticwhere T: Copy + PartialEq + Zero + One + WrappingAdd + WrappingSub + WrappingMul + WrappingNeg + Div<T, Output = T>, usize: TryFrom<T>,
source§impl Clone for WrappingArithmetic
impl Clone for WrappingArithmetic
source§fn clone(&self) -> WrappingArithmetic
fn clone(&self) -> WrappingArithmetic
Returns a copy 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 WrappingArithmetic
impl Debug for WrappingArithmetic
source§impl Default for WrappingArithmetic
impl Default for WrappingArithmetic
source§fn default() -> WrappingArithmetic
fn default() -> WrappingArithmetic
Returns the “default value” for a type. Read more
source§impl<T> OrdArithmetic<T> for WrappingArithmeticwhere
Self: Arithmetic<T>,
T: PartialOrd,
impl<T> OrdArithmetic<T> for WrappingArithmeticwhere Self: Arithmetic<T>, T: PartialOrd,
impl Copy for WrappingArithmetic
Auto Trait Implementations§
impl RefUnwindSafe for WrappingArithmetic
impl Send for WrappingArithmetic
impl Sync for WrappingArithmetic
impl Unpin for WrappingArithmetic
impl UnwindSafe for WrappingArithmetic
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