Struct amplify_num::u5 [−][src]
pub struct u5(_);
Expand description
5-bit unsigned integer in the range 0..32
Implementations
impl u5
[src]
impl u5
[src]impl u5
[src]
impl u5
[src]pub fn checked_add<T>(self, rhs: T) -> Option<Self> where
T: Into<u8>,
[src]
pub fn checked_add<T>(self, rhs: T) -> Option<Self> where
T: Into<u8>,
[src]Checked integer addition. Computes self + rhs
, returning None
if
overflow occurred.
pub fn saturating_add<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]
pub fn saturating_add<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]Saturating integer addition. Computes self + rhs
, saturating at the
numeric bounds instead of overflowing.
pub fn overflowing_add<T>(self, rhs: T) -> (Self, bool) where
T: Into<u8>,
[src]
pub fn overflowing_add<T>(self, rhs: T) -> (Self, bool) where
T: Into<u8>,
[src]Calculates self + rhs
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
pub fn wrapping_add<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]
pub fn wrapping_add<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]Wrapping (modular) addition. Computes self + rhs
, wrapping around at
the boundary of the type.
pub fn checked_sub<T>(self, rhs: T) -> Option<Self> where
T: Into<u8>,
[src]
pub fn checked_sub<T>(self, rhs: T) -> Option<Self> where
T: Into<u8>,
[src]Checked integer subtraction. Computes self - rhs
, returning None
if
overflow occurred.
pub fn saturating_sub<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]
pub fn saturating_sub<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]Saturating integer subtraction. Computes self - rhs
, saturating at the
numeric bounds instead of overflowing.
pub fn overflowing_sub<T>(self, rhs: T) -> (Self, bool) where
T: Into<u8>,
[src]
pub fn overflowing_sub<T>(self, rhs: T) -> (Self, bool) where
T: Into<u8>,
[src]Calculates self - rhs
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
pub fn wrapping_sub<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]
pub fn wrapping_sub<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]Wrapping (modular) subtraction. Computes self - rhs
, wrapping around at
the boundary of the type.
pub fn checked_mul<T>(self, rhs: T) -> Option<Self> where
T: Into<u8>,
[src]
pub fn checked_mul<T>(self, rhs: T) -> Option<Self> where
T: Into<u8>,
[src]Checked integer multiplication. Computes self * rhs
, returning None
if
overflow occurred.
pub fn saturating_mul<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]
pub fn saturating_mul<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]Saturating integer multiplication. Computes self * rhs
, saturating at the
numeric bounds instead of overflowing.
pub fn overflowing_mul<T>(self, rhs: T) -> (Self, bool) where
T: Into<u8>,
[src]
pub fn overflowing_mul<T>(self, rhs: T) -> (Self, bool) where
T: Into<u8>,
[src]Calculates self * rhs
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
pub fn wrapping_mul<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]
pub fn wrapping_mul<T>(self, rhs: T) -> Self where
T: Into<u8>,
[src]Wrapping (modular) multiplication. Computes self * rhs
, wrapping around at
the boundary of the type.
Trait Implementations
impl<T> AddAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> AddAssign<T> for u5 where
T: Into<u8>,
[src]fn add_assign(&mut self, rhs: T)
[src]
fn add_assign(&mut self, rhs: T)
[src]Performs the +=
operation. Read more
impl<T> BitAndAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> BitAndAssign<T> for u5 where
T: Into<u8>,
[src]fn bitand_assign(&mut self, rhs: T)
[src]
fn bitand_assign(&mut self, rhs: T)
[src]Performs the &=
operation. Read more
impl<T> BitOrAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> BitOrAssign<T> for u5 where
T: Into<u8>,
[src]fn bitor_assign(&mut self, rhs: T)
[src]
fn bitor_assign(&mut self, rhs: T)
[src]Performs the |=
operation. Read more
impl<T> BitXorAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> BitXorAssign<T> for u5 where
T: Into<u8>,
[src]fn bitxor_assign(&mut self, rhs: T)
[src]
fn bitxor_assign(&mut self, rhs: T)
[src]Performs the ^=
operation. Read more
impl<T> DivAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> DivAssign<T> for u5 where
T: Into<u8>,
[src]fn div_assign(&mut self, rhs: T)
[src]
fn div_assign(&mut self, rhs: T)
[src]Performs the /=
operation. Read more
impl<T> MulAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> MulAssign<T> for u5 where
T: Into<u8>,
[src]fn mul_assign(&mut self, rhs: T)
[src]
fn mul_assign(&mut self, rhs: T)
[src]Performs the *=
operation. Read more
impl Ord for u5
[src]
impl Ord for u5
[src]impl PartialOrd<u5> for u5
[src]
impl PartialOrd<u5> for u5
[src]fn partial_cmp(&self, other: &u5) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &u5) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T> RemAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> RemAssign<T> for u5 where
T: Into<u8>,
[src]fn rem_assign(&mut self, rhs: T)
[src]
fn rem_assign(&mut self, rhs: T)
[src]Performs the %=
operation. Read more
impl<T> ShlAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> ShlAssign<T> for u5 where
T: Into<u8>,
[src]fn shl_assign(&mut self, rhs: T)
[src]
fn shl_assign(&mut self, rhs: T)
[src]Performs the <<=
operation. Read more
impl<T> ShrAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> ShrAssign<T> for u5 where
T: Into<u8>,
[src]fn shr_assign(&mut self, rhs: T)
[src]
fn shr_assign(&mut self, rhs: T)
[src]Performs the >>=
operation. Read more
impl<T> SubAssign<T> for u5 where
T: Into<u8>,
[src]
impl<T> SubAssign<T> for u5 where
T: Into<u8>,
[src]fn sub_assign(&mut self, rhs: T)
[src]
fn sub_assign(&mut self, rhs: T)
[src]Performs the -=
operation. Read more