Struct oxidd_core::util::num::Saturating
source · pub struct Saturating<T>(pub T);Expand description
Natural numbers with saturating arithmetic
In contrast to std::num::Saturating, T::MAX represents an
out-of-bounds value, and a subsequent subtraction or right shift does not
change this value.
Tuple Fields§
§0: TTrait Implementations§
source§impl<'a> AddAssign<&'a Saturating<u128>> for Saturating<u128>
impl<'a> AddAssign<&'a Saturating<u128>> for Saturating<u128>
source§fn add_assign(&mut self, rhs: &'a Self)
fn add_assign(&mut self, rhs: &'a Self)
Performs the
+= operation. Read moresource§impl<'a> AddAssign<&'a Saturating<u64>> for Saturating<u64>
impl<'a> AddAssign<&'a Saturating<u64>> for Saturating<u64>
source§fn add_assign(&mut self, rhs: &'a Self)
fn add_assign(&mut self, rhs: &'a Self)
Performs the
+= operation. Read moresource§impl<T: Clone> Clone for Saturating<T>
impl<T: Clone> Clone for Saturating<T>
source§fn clone(&self) -> Saturating<T>
fn clone(&self) -> Saturating<T>
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<T: Hash> Hash for Saturating<T>
impl<T: Hash> Hash for Saturating<T>
source§impl<T> IsFloatingPoint for Saturating<T>
impl<T> IsFloatingPoint for Saturating<T>
source§const FLOATING_POINT: bool = false
const FLOATING_POINT: bool = false
true iff the underlying type is a floating point numbersource§impl<T: Ord> Ord for Saturating<T>
impl<T: Ord> Ord for Saturating<T>
source§fn cmp(&self, other: &Saturating<T>) -> Ordering
fn cmp(&self, other: &Saturating<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq for Saturating<T>
impl<T: PartialEq> PartialEq for Saturating<T>
source§fn eq(&self, other: &Saturating<T>) -> bool
fn eq(&self, other: &Saturating<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: PartialOrd> PartialOrd for Saturating<T>
impl<T: PartialOrd> PartialOrd for Saturating<T>
source§fn partial_cmp(&self, other: &Saturating<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Saturating<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl ShlAssign<u32> for Saturating<u128>
impl ShlAssign<u32> for Saturating<u128>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<= operation. Read moresource§impl ShlAssign<u32> for Saturating<u64>
impl ShlAssign<u32> for Saturating<u64>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<= operation. Read moresource§impl ShrAssign<u32> for Saturating<u128>
impl ShrAssign<u32> for Saturating<u128>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>= operation. Read moresource§impl ShrAssign<u32> for Saturating<u64>
impl ShrAssign<u32> for Saturating<u64>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>= operation. Read moresource§impl<'a> SubAssign<&'a Saturating<u128>> for Saturating<u128>
impl<'a> SubAssign<&'a Saturating<u128>> for Saturating<u128>
source§fn sub_assign(&mut self, rhs: &'a Self)
fn sub_assign(&mut self, rhs: &'a Self)
Performs the
-= operation. Read moresource§impl<'a> SubAssign<&'a Saturating<u64>> for Saturating<u64>
impl<'a> SubAssign<&'a Saturating<u64>> for Saturating<u64>
source§fn sub_assign(&mut self, rhs: &'a Self)
fn sub_assign(&mut self, rhs: &'a Self)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for Saturating<T>
impl<T: Eq> Eq for Saturating<T>
impl<T> StructuralPartialEq for Saturating<T>
Auto Trait Implementations§
impl<T> Freeze for Saturating<T>where
T: Freeze,
impl<T> RefUnwindSafe for Saturating<T>where
T: RefUnwindSafe,
impl<T> Send for Saturating<T>where
T: Send,
impl<T> Sync for Saturating<T>where
T: Sync,
impl<T> Unpin for Saturating<T>where
T: Unpin,
impl<T> UnwindSafe for Saturating<T>where
T: UnwindSafe,
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