pub struct FixedUInt<T, const N: usize>where
T: MachineWord,{ /* private fields */ }
Expand description
Fixed-size unsigned integer, represented by array of N words of builtin unsigned type T
Implementations§
Source§impl<T: MachineWord, const N: usize> FixedUInt<T, N>
impl<T: MachineWord, const N: usize> FixedUInt<T, N>
Sourcepub fn bit_length(&self) -> u32
pub fn bit_length(&self) -> u32
Returns number of used bits.
Sourcepub fn div_rem(&self, divisor: &Self) -> (Self, Self)
pub fn div_rem(&self, divisor: &Self) -> (Self, Self)
Performs a division, returning both the quotient and reminder in a tuple.
Sourcepub fn from_le_bytes(bytes: &[u8]) -> Self
pub fn from_le_bytes(bytes: &[u8]) -> Self
Create a little-endian integer value from its representation as a byte array in little endian.
Sourcepub fn from_be_bytes(bytes: &[u8]) -> Self
pub fn from_be_bytes(bytes: &[u8]) -> Self
Create a big-endian integer value from its representation as a byte array in big endian.
Sourcepub fn to_le_bytes<'a>(
&self,
output_buffer: &'a mut [u8],
) -> Result<&'a [u8], bool>
pub fn to_le_bytes<'a>( &self, output_buffer: &'a mut [u8], ) -> Result<&'a [u8], bool>
Converts the FixedUInt into a little-endian byte array.
Sourcepub fn to_be_bytes<'a>(
&self,
output_buffer: &'a mut [u8],
) -> Result<&'a [u8], bool>
pub fn to_be_bytes<'a>( &self, output_buffer: &'a mut [u8], ) -> Result<&'a [u8], bool>
Converts the FixedUInt into a big-endian byte array.
Trait Implementations§
Source§impl<T: MachineWord, const N: usize> AddAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> AddAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
+=
operation. Read moreSource§impl<T: MachineWord, const N: usize> AddAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> AddAssign for FixedUInt<T, N>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moreSource§impl<T: MachineWord, const N: usize> BitAndAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> BitAndAssign for FixedUInt<T, N>
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
&=
operation. Read moreSource§impl<T: MachineWord, const N: usize> BitOrAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> BitOrAssign for FixedUInt<T, N>
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|=
operation. Read moreSource§impl<T: MachineWord, const N: usize> BitXorAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> BitXorAssign for FixedUInt<T, N>
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
^=
operation. Read moreSource§impl<T: MachineWord, const N: usize> CheckedAdd for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedAdd for FixedUInt<T, N>
Source§fn checked_add(&self, other: &Self) -> Option<Self>
fn checked_add(&self, other: &Self) -> Option<Self>
None
is
returned.Source§impl<T: MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N>
Source§fn checked_div(&self, other: &Self) -> Option<Self>
fn checked_div(&self, other: &Self) -> Option<Self>
None
is returned.Source§impl<T: MachineWord, const N: usize> CheckedEuclid for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedEuclid for FixedUInt<T, N>
Source§fn checked_div_euclid(&self, v: &Self) -> Option<Self>
fn checked_div_euclid(&self, v: &Self) -> Option<Self>
None
instead of panicking on division by zero
and instead of wrapping around on underflow and overflow.Source§fn checked_rem_euclid(&self, v: &Self) -> Option<Self>
fn checked_rem_euclid(&self, v: &Self) -> Option<Self>
None
is returned.Source§fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
fn checked_div_rem_euclid(&self, v: &Self) -> Option<(Self, Self)>
Source§impl<T: MachineWord, const N: usize> CheckedMul for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedMul for FixedUInt<T, N>
Source§fn checked_mul(&self, other: &Self) -> Option<Self>
fn checked_mul(&self, other: &Self) -> Option<Self>
None
is returned.Source§impl<T: MachineWord, const N: usize> CheckedRem for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedRem for FixedUInt<T, N>
Source§fn checked_rem(&self, other: &Self) -> Option<Self>
fn checked_rem(&self, other: &Self) -> Option<Self>
None
is returned. Read moreSource§impl<T: MachineWord, const N: usize> CheckedShl for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedShl for FixedUInt<T, N>
Source§impl<T: MachineWord, const N: usize> CheckedShr for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedShr for FixedUInt<T, N>
Source§impl<T: MachineWord, const N: usize> CheckedSub for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> CheckedSub for FixedUInt<T, N>
Source§fn checked_sub(&self, other: &Self) -> Option<Self>
fn checked_sub(&self, other: &Self) -> Option<Self>
None
is returned.Source§impl<T: MachineWord, const N: usize> DivAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> DivAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
Source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
/=
operation. Read moreSource§impl<T: MachineWord, const N: usize> DivAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> DivAssign for FixedUInt<T, N>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/=
operation. Read moreSource§impl<T: MachineWord, const N: usize> Euclid for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> Euclid for FixedUInt<T, N>
Source§fn div_euclid(&self, v: &Self) -> Self
fn div_euclid(&self, v: &Self) -> Self
rem_euclid
. Read moreSource§fn rem_euclid(&self, v: &Self) -> Self
fn rem_euclid(&self, v: &Self) -> Self
self (mod v)
. Read moreSource§fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
fn div_rem_euclid(&self, v: &Self) -> (Self, Self)
Source§impl<T: MachineWord, const N: usize> FromPrimitive for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> FromPrimitive for FixedUInt<T, N>
Source§fn from_i64(_: i64) -> Option<Self>
fn from_i64(_: i64) -> Option<Self>
i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_u64(input: u64) -> Option<Self>
fn from_u64(input: u64) -> Option<Self>
u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moreSource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned.Source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read moreSource§impl<T: MachineWord, const N: usize> Integer for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> Integer for FixedUInt<T, N>
Source§fn divides(&self, other: &Self) -> bool
fn divides(&self, other: &Self) -> bool
is_multiple_of
instead.Source§fn is_multiple_of(&self, other: &Self) -> bool
fn is_multiple_of(&self, other: &Self) -> bool
Source§fn div_rem(&self, other: &Self) -> (Self, Self)
fn div_rem(&self, other: &Self) -> (Self, Self)
(quotient, remainder)
. Read moreSource§fn gcd_lcm(&self, other: &Self) -> (Self, Self)
fn gcd_lcm(&self, other: &Self) -> (Self, Self)
Source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where
Self: Clone,
fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where
Self: Clone,
Source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
fn div_mod_floor(&self, other: &Self) -> (Self, Self)
(quotient, remainder)
. Read moreSource§fn next_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
fn next_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
Source§fn prev_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
fn prev_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
Source§impl<T: MachineWord, const N: usize> MulAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> MulAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
Source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
*=
operation. Read moreSource§impl<T: MachineWord, const N: usize> MulAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> MulAssign for FixedUInt<T, N>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*=
operation. Read moreSource§impl<T: MachineWord, const N: usize> Num for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> Num for FixedUInt<T, N>
type FromStrRadixErr = ParseIntError
Source§fn from_str_radix(
input: &str,
radix: u32,
) -> Result<Self, <Self as Num>::FromStrRadixErr>
fn from_str_radix( input: &str, radix: u32, ) -> Result<Self, <Self as Num>::FromStrRadixErr>
2..=36
). Read moreSource§impl<T: MachineWord, const N: usize> Ord for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> Ord for FixedUInt<T, N>
Source§impl<T: MachineWord, const N: usize> OverflowingAdd for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> OverflowingAdd for FixedUInt<T, N>
Source§fn overflowing_add(&self, other: &Self) -> (Self, bool)
fn overflowing_add(&self, other: &Self) -> (Self, bool)
Source§impl<T: MachineWord, const N: usize> OverflowingMul for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> OverflowingMul for FixedUInt<T, N>
Source§fn overflowing_mul(&self, other: &Self) -> (Self, bool)
fn overflowing_mul(&self, other: &Self) -> (Self, bool)
Source§impl<T: MachineWord, const N: usize> OverflowingShl for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> OverflowingShl for FixedUInt<T, N>
fn overflowing_shl(self, bits: u32) -> (Self, bool)
Source§impl<T: MachineWord, const N: usize> OverflowingShr for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> OverflowingShr for FixedUInt<T, N>
fn overflowing_shr(self, bits: u32) -> (Self, bool)
Source§impl<T: MachineWord, const N: usize> OverflowingSub for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> OverflowingSub for FixedUInt<T, N>
Source§fn overflowing_sub(&self, other: &Self) -> (Self, bool)
fn overflowing_sub(&self, other: &Self) -> (Self, bool)
Source§impl<T: MachineWord, const N: usize> PartialOrd for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> PartialOrd for FixedUInt<T, N>
Source§impl<T: MachineWord, const N: usize> PrimInt for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> PrimInt for FixedUInt<T, N>
Source§fn count_ones(self) -> u32
fn count_ones(self) -> u32
self
. Read moreSource§fn count_zeros(self) -> u32
fn count_zeros(self) -> u32
self
. Read moreSource§fn leading_zeros(self) -> u32
fn leading_zeros(self) -> u32
self
. Read moreSource§fn trailing_zeros(self) -> u32
fn trailing_zeros(self) -> u32
self
. Read moreSource§fn rotate_left(self, bits: u32) -> Self
fn rotate_left(self, bits: u32) -> Self
n
, wrapping
the truncated bits to the end of the resulting integer. Read moreSource§fn rotate_right(self, bits: u32) -> Self
fn rotate_right(self, bits: u32) -> Self
n
, wrapping
the truncated bits to the beginning of the resulting integer. Read moreSource§fn signed_shl(self, _: u32) -> Self
fn signed_shl(self, _: u32) -> Self
n
, filling
zeros in the least significant bits. Read moreSource§fn signed_shr(self, _: u32) -> Self
fn signed_shr(self, _: u32) -> Self
n
, copying
the “sign bit” in the most significant bits even for unsigned types. Read moreSource§fn unsigned_shl(self, bits: u32) -> Self
fn unsigned_shl(self, bits: u32) -> Self
n
, filling
zeros in the least significant bits. Read moreSource§fn unsigned_shr(self, bits: u32) -> Self
fn unsigned_shr(self, bits: u32) -> Self
n
, filling
zeros in the most significant bits. Read moreSource§fn swap_bytes(self) -> Self
fn swap_bytes(self) -> Self
Source§fn from_be(source: Self) -> Self
fn from_be(source: Self) -> Self
Source§fn from_le(source: Self) -> Self
fn from_le(source: Self) -> Self
Source§fn pow(self, n: u32) -> Self
fn pow(self, n: u32) -> Self
exp
, using exponentiation by squaring. Read moreSource§fn leading_ones(self) -> u32
fn leading_ones(self) -> u32
self
. Read moreSource§fn trailing_ones(self) -> u32
fn trailing_ones(self) -> u32
self
. Read moreSource§fn reverse_bits(self) -> Self
fn reverse_bits(self) -> Self
Source§impl<T: MachineWord, const N: usize> RemAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> RemAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
Source§fn rem_assign(&mut self, other: &Self)
fn rem_assign(&mut self, other: &Self)
%=
operation. Read moreSource§impl<T: MachineWord, const N: usize> RemAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> RemAssign for FixedUInt<T, N>
Source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
%=
operation. Read moreSource§impl<T: MachineWord, const N: usize> Saturating for FixedUInt<T, N>
Note: This is marked deprecated, but still used by PrimInt
impl<T: MachineWord, const N: usize> Saturating for FixedUInt<T, N>
Note: This is marked deprecated, but still used by PrimInt
Source§fn saturating_add(self, other: Self) -> Self
fn saturating_add(self, other: Self) -> Self
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
Source§fn saturating_sub(self, other: Self) -> Self
fn saturating_sub(self, other: Self) -> Self
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
Source§impl<T: MachineWord, const N: usize> SaturatingAdd for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> SaturatingAdd for FixedUInt<T, N>
Source§fn saturating_add(&self, other: &Self) -> Self
fn saturating_add(&self, other: &Self) -> Self
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
Source§impl<T: MachineWord, const N: usize> SaturatingMul for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> SaturatingMul for FixedUInt<T, N>
Source§fn saturating_mul(&self, other: &Self) -> Self
fn saturating_mul(&self, other: &Self) -> Self
self * other
, saturating at the relevant high or low boundary of
the type.Source§impl<T: MachineWord, const N: usize> SaturatingSub for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> SaturatingSub for FixedUInt<T, N>
Source§fn saturating_sub(&self, other: &Self) -> Self
fn saturating_sub(&self, other: &Self) -> Self
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
Source§impl<T: MachineWord, const N: usize> ShlAssign<&usize> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> ShlAssign<&usize> for FixedUInt<T, N>
Source§fn shl_assign(&mut self, bits: &usize)
fn shl_assign(&mut self, bits: &usize)
<<=
operation. Read moreSource§impl<T: MachineWord, const N: usize> ShlAssign<usize> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> ShlAssign<usize> for FixedUInt<T, N>
Source§fn shl_assign(&mut self, bits: usize)
fn shl_assign(&mut self, bits: usize)
<<=
operation. Read moreSource§impl<T: MachineWord, const N: usize> ShrAssign<&usize> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> ShrAssign<&usize> for FixedUInt<T, N>
Source§fn shr_assign(&mut self, bits: &usize)
fn shr_assign(&mut self, bits: &usize)
>>=
operation. Read moreSource§impl<T: MachineWord, const N: usize> ShrAssign<usize> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> ShrAssign<usize> for FixedUInt<T, N>
Source§fn shr_assign(&mut self, bits: usize)
fn shr_assign(&mut self, bits: usize)
>>=
operation. Read moreSource§impl<T: MachineWord, const N: usize> SubAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> SubAssign<&FixedUInt<T, N>> for FixedUInt<T, N>
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
-=
operation. Read moreSource§impl<T: MachineWord, const N: usize> SubAssign for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> SubAssign for FixedUInt<T, N>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moreSource§impl<T: MachineWord, const N: usize> ToPrimitive for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> ToPrimitive for FixedUInt<T, N>
Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned.Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned.Source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
self
to a u128
. If the value cannot be
represented by a u128
(u64
under the default implementation), then
None
is returned. Read moreSource§impl<T: MachineWord, const N: usize> WrappingAdd for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> WrappingAdd for FixedUInt<T, N>
Source§fn wrapping_add(&self, other: &Self) -> Self
fn wrapping_add(&self, other: &Self) -> Self
self + other
, wrapping around at the boundary of
the type.Source§impl<T: MachineWord, const N: usize> WrappingMul for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> WrappingMul for FixedUInt<T, N>
Source§fn wrapping_mul(&self, other: &Self) -> Self
fn wrapping_mul(&self, other: &Self) -> Self
self * other
, wrapping around at the boundary
of the type.Source§impl<T: MachineWord, const N: usize> WrappingShl for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> WrappingShl for FixedUInt<T, N>
Source§fn wrapping_shl(&self, bits: u32) -> Self
fn wrapping_shl(&self, bits: u32) -> Self
self << mask(rhs)
,
where mask
removes any high order bits of rhs
that would
cause the shift to exceed the bitwidth of the type. Read moreSource§impl<T: MachineWord, const N: usize> WrappingShr for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> WrappingShr for FixedUInt<T, N>
Source§fn wrapping_shr(&self, bits: u32) -> Self
fn wrapping_shr(&self, bits: u32) -> Self
self >> mask(rhs)
,
where mask
removes any high order bits of rhs
that would
cause the shift to exceed the bitwidth of the type. Read moreSource§impl<T: MachineWord, const N: usize> WrappingSub for FixedUInt<T, N>
impl<T: MachineWord, const N: usize> WrappingSub for FixedUInt<T, N>
Source§fn wrapping_sub(&self, other: &Self) -> Self
fn wrapping_sub(&self, other: &Self) -> Self
self - other
, wrapping around at the boundary
of the type.impl<T, const N: usize> Copy for FixedUInt<T, N>where
T: MachineWord + Copy,
impl<T, const N: usize> Eq for FixedUInt<T, N>where
T: MachineWord + Eq,
impl<T, const N: usize> StructuralPartialEq for FixedUInt<T, N>where
T: MachineWord,
impl<T: MachineWord, const N: usize> Unsigned for FixedUInt<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for FixedUInt<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for FixedUInt<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for FixedUInt<T, N>where
T: Send,
impl<T, const N: usize> Sync for FixedUInt<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for FixedUInt<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for FixedUInt<T, N>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<I> Average for I
impl<I> Average for I
Source§fn average_floor(&self, other: &I) -> I
fn average_floor(&self, other: &I) -> I
Returns the floor value of the average of self
and other
.
Source§fn average_ceil(&self, other: &I) -> I
fn average_ceil(&self, other: &I) -> I
Returns the ceil value of the average of self
and other
.