Struct extprim::traits::Wrapping
[−]
[src]
pub struct Wrapping<T>(pub T);
Wrapper for u128
and i128
to turn arithmetic operators to wrapping ones.
Equivalent to std::num::Wrapping
, but due to E0117 (orphan rule) we need to define it here to
implement operators on it.
Trait Implementations
impl<T: PartialEq> PartialEq for Wrapping<T>
[src]
fn eq(&self, __arg_0: &Wrapping<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Wrapping<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for Wrapping<T>
[src]
impl<T: PartialOrd> PartialOrd for Wrapping<T>
[src]
fn partial_cmp(&self, __arg_0: &Wrapping<T>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Wrapping<T>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Wrapping<T>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Wrapping<T>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Wrapping<T>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord> Ord for Wrapping<T>
[src]
fn cmp(&self, __arg_0: &Wrapping<T>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<T: Clone> Clone for Wrapping<T>
[src]
fn clone(&self) -> Wrapping<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Wrapping<T>
[src]
impl<T: Debug> Debug for Wrapping<T>
[src]
impl<T: Default> Default for Wrapping<T>
[src]
impl Add<Wrapping<u128>> for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Wrapping<u128>) -> Self
[src]
Performs the +
operation.
impl Sub<Wrapping<u128>> for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Wrapping<u128>) -> Self
[src]
Performs the -
operation.
impl Neg for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self
[src]
Performs the unary -
operation.
impl Not for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self
[src]
Performs the unary !
operation.
impl BitAnd for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self
[src]
Performs the &
operation.
impl BitOr for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self
[src]
Performs the |
operation.
impl BitXor for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, other: Self) -> Self
[src]
Performs the ^
operation.
impl Shl<u32> for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the <<
operator.
fn shl(self, other: u32) -> Self
[src]
Performs the <<
operation.
impl Shr<u32> for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the >>
operator.
fn shr(self, other: u32) -> Self
[src]
Performs the >>
operation.
impl Mul<Wrapping<u128>> for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Wrapping<u128>) -> Self
[src]
Performs the *
operation.
impl Mul<Wrapping<u64>> for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Wrapping<u64>) -> Self
[src]
Performs the *
operation.
impl Mul<Wrapping<u128>> for Wrapping<u64>
[src]
type Output = Wrapping<u128>
The resulting type after applying the *
operator.
fn mul(self, other: Wrapping<u128>) -> Wrapping<u128>
[src]
Performs the *
operation.
impl Div for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self
[src]
Performs the /
operation.
impl Rem for Wrapping<u128>
[src]
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, other: Self) -> Self
[src]
Performs the %
operation.
impl Add<Wrapping<i128>> for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Wrapping<i128>) -> Self
[src]
Performs the +
operation.
impl Sub<Wrapping<i128>> for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Wrapping<i128>) -> Self
[src]
Performs the -
operation.
impl Neg for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self
[src]
Performs the unary -
operation.
impl Not for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self
[src]
Performs the unary !
operation.
impl BitAnd for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self
[src]
Performs the &
operation.
impl BitOr for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self
[src]
Performs the |
operation.
impl BitXor for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, other: Self) -> Self
[src]
Performs the ^
operation.
impl Shl<u32> for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the <<
operator.
fn shl(self, other: u32) -> Self
[src]
Performs the <<
operation.
impl Shr<u32> for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the >>
operator.
fn shr(self, other: u32) -> Self
[src]
Performs the >>
operation.
impl Mul<Wrapping<i128>> for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Wrapping<i128>) -> Self
[src]
Performs the *
operation.
impl Div for Wrapping<i128>
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self
[src]
Performs the /
operation.