pub struct FixedUInt<T, const N: usize, P: Personality = Nct>where
T: MachineWord,{ /* private fields */ }Expand description
Fixed-size unsigned integer, represented by array of N words of builtin unsigned type T.
The optional P: Personality parameter selects which implementations of
operation primitives are used at each call site. Defaults to Nct
(non-constant-time). Use FixedUInt<T, N, Ct> for
values that must be handled in constant time. See const_num_traits::personality.
Implementations§
Source§impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
Sourcepub fn to_le_bytes_fixed<'a, const M: usize>(
&self,
out: &'a mut [u8; M],
) -> &'a [u8]
pub fn to_le_bytes_fixed<'a, const M: usize>( &self, out: &'a mut [u8; M], ) -> &'a [u8]
Serialize little-endian into a fixed-size buffer. The const
M >= BYTE_WIDTH precondition fires at monomorphization, so
wrong-size callers fail at compile time and the produced binary
contains no runtime panic path from this method.
Returns the written prefix (&out[..BYTE_WIDTH]). If
M > BYTE_WIDTH, the trailing bytes of out are left untouched.
use fixed_bigint::FixedUInt;
type U16 = FixedUInt<u8, 2>;
let v = U16::from(0x1234u16);
let mut buf = [0u8; U16::BYTE_WIDTH];
let bytes = v.to_le_bytes_fixed(&mut buf);
assert_eq!(bytes, &[0x34, 0x12]);Sourcepub fn to_be_bytes_fixed<'a, const M: usize>(
&self,
out: &'a mut [u8; M],
) -> &'a [u8]
pub fn to_be_bytes_fixed<'a, const M: usize>( &self, out: &'a mut [u8; M], ) -> &'a [u8]
Big-endian counterpart of to_le_bytes_fixed;
same const-asserted size guarantee and same panic-free intent.
Returns the written window &out[M - BYTE_WIDTH ..]. If
M > BYTE_WIDTH, the leading bytes of out are left untouched
— mirror image of to_le_bytes_fixed, aligning the value with
the trailing window that from_be_bytes_fixed reads.
use fixed_bigint::FixedUInt;
type U16 = FixedUInt<u8, 2>;
let v = U16::from(0x1234u16);
let mut buf = [0u8; U16::BYTE_WIDTH];
let bytes = v.to_be_bytes_fixed(&mut buf);
assert_eq!(bytes, &[0x12, 0x34]);Sourcepub fn from_le_bytes_fixed<const M: usize>(bytes: &[u8; M]) -> Self
pub fn from_le_bytes_fixed<const M: usize>(bytes: &[u8; M]) -> Self
Deserialize from a fixed-size little-endian buffer. The const
M >= BYTE_WIDTH precondition fires at monomorphization. Reads
the first BYTE_WIDTH bytes (LE low-order bytes are at the
front); trailing bytes if M > BYTE_WIDTH are ignored.
use fixed_bigint::FixedUInt;
type U16 = FixedUInt<u8, 2>;
let buf = [0x34u8, 0x12];
let v = U16::from_le_bytes_fixed(&buf);
assert_eq!(v, U16::from(0x1234u16));Sourcepub fn from_be_bytes_fixed<const M: usize>(bytes: &[u8; M]) -> Self
pub fn from_be_bytes_fixed<const M: usize>(bytes: &[u8; M]) -> Self
Deserialize from a fixed-size big-endian buffer. The const
M >= BYTE_WIDTH precondition fires at monomorphization. Reads
the last BYTE_WIDTH bytes (BE low-order bytes are at the end);
leading bytes if M > BYTE_WIDTH are ignored.
use fixed_bigint::FixedUInt;
type U16 = FixedUInt<u8, 2>;
let buf = [0x12u8, 0x34];
let v = U16::from_be_bytes_fixed(&buf);
assert_eq!(v, U16::from(0x1234u16));Source§impl<T: ConstMachineWord + MachineWord, const N: usize> FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> FixedUInt<T, N, Nct>
Sourcepub fn checked_div_ceil(self, rhs: Self) -> Option<Self>
pub fn checked_div_ceil(self, rhs: Self) -> Option<Self>
div_ceil variant returning None on divide-by-zero or overflow.
Not itself const fn — the c0nst! macro can’t emit [c0nst]
bounds on inherent impls. Nightly callers wanting the const path
call checked_div_ceil_impl (the free pub(crate) c0nst fn
above) directly.
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> FixedUInt<T, N, Nct>
Sourcepub fn checked_isqrt(self) -> Option<Self>
pub fn checked_isqrt(self) -> Option<Self>
Unsigned isqrt cannot fail; always returns Some.
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
Sourcepub fn from_power_of_two(p: PowerOfTwo<FixedUInt<T, N, P>>) -> Self
pub fn from_power_of_two(p: PowerOfTwo<FixedUInt<T, N, P>>) -> Self
Reconstructs the value 1 << p.exp() proven by p. Symmetric
with the safe upstream constructor PowerOfTwo::new_checked.
Source§impl<T: MachineWord, const N: usize> FixedUInt<T, N, Ct>
impl<T: MachineWord, const N: usize> FixedUInt<T, N, Ct>
Sourcepub const fn forget_ct(self) -> FixedUInt<T, N, Nct>
pub const fn forget_ct(self) -> FixedUInt<T, N, Nct>
Drop the CT guarantee and convert to the Nct variant.
This is an explicit downgrade. The caller is asserting that the value is no longer secret — typically because the CT-handling window has ended (e.g. a finalized signature, a published key, a post-reduction modular value about to be serialized).
Source§impl<T: MachineWord + ConditionallySelectable, const N: usize> FixedUInt<T, N, Ct>
impl<T: MachineWord + ConditionallySelectable, const N: usize> FixedUInt<T, N, Ct>
Sourcepub fn ct_checked_add(&self, other: &Self) -> CtOption<Self>
pub fn ct_checked_add(&self, other: &Self) -> CtOption<Self>
CT-friendly counterpart to num_traits::CheckedAdd::checked_add.
Returns CtOption::new(res, Choice::from(!overflow)) — the result is
always computed (always-iterate via overflowing_add), and the
validity Choice carries the overflow flag without exposing it as
a control-flow signal.
Sourcepub fn ct_checked_sub(&self, other: &Self) -> CtOption<Self>
pub fn ct_checked_sub(&self, other: &Self) -> CtOption<Self>
CT-friendly counterpart to num_traits::CheckedSub::checked_sub.
Sourcepub fn ct_checked_mul(&self, other: &Self) -> CtOption<Self>
pub fn ct_checked_mul(&self, other: &Self) -> CtOption<Self>
CT-friendly counterpart to num_traits::CheckedMul::checked_mul.
Sourcepub fn ct_checked_shl(&self, bits: u32) -> CtOption<Self>
pub fn ct_checked_shl(&self, bits: u32) -> CtOption<Self>
CT-friendly counterpart to CheckedShl::checked_shl.
The value is computed via const_unbounded_shl_u32, which under
Ct uses a branchless barrel shifter and a CT-safe min(bits, BIT_SIZE) clamp. The overflow flag (bits >= BIT_SIZE) is
derived branchlessly here — never going through
OverflowingShl::overflowing_shl which routes through
normalize_shift_amount’s tainted branch + variable-time modulo.
Sourcepub fn ct_checked_shr(&self, bits: u32) -> CtOption<Self>
pub fn ct_checked_shr(&self, bits: u32) -> CtOption<Self>
CT-friendly counterpart to CheckedShr::checked_shr.
Symmetric to Self::ct_checked_shl: value through
const_unbounded_shr_u32, validity flag derived branchlessly.
Sourcepub fn ct_checked_next_power_of_two(self) -> CtOption<Self>where
T: ConstantTimeEq,
pub fn ct_checked_next_power_of_two(self) -> CtOption<Self>where
T: ConstantTimeEq,
CT-friendly counterpart to NextPowerOfTwo::checked_next_power_of_two.
pub fn ct_checked_pow(self, exp: u32) -> CtOption<Self>
Source§impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
Sourcepub const BYTE_WIDTH: usize = Self::BYTE_SIZE
pub const BYTE_WIDTH: usize = Self::BYTE_SIZE
The serialized byte width of this FixedUInt type, N * size_of::<T>().
Public alias of the internal BYTE_SIZE for callers sizing buffers
to feed the *_bytes_fixed panic-free byte conversion methods. Use
as const BUF_LEN: usize = MyFixed::BYTE_WIDTH; then
let mut buf = [0u8; BUF_LEN];.
Sourcepub fn bit_length(&self) -> u32
pub fn bit_length(&self) -> u32
Returns number of used bits.
Source§impl<T: MachineWord, const N: usize> FixedUInt<T, N, Nct>
impl<T: MachineWord, const N: usize> FixedUInt<T, N, Nct>
Source§impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
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.
Source§impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> AbsDiff for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AbsDiff for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AbsDiff for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AbsDiff for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Add<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AddAssign for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AddAssign for FixedUInt<T, N, P>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AddAssign<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> AddAssign<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
+= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAnd<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAndAssign for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitAndAssign for FixedUInt<T, N, P>
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
&= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOr<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOrAssign for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitOrAssign for FixedUInt<T, N, P>
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitWidth for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitWidth for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitWidth for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitWidth for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXor<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXorAssign for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> BitXorAssign for FixedUInt<T, N, P>
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
^= operation. Read moreSource§impl<T: ConstMachineWord + BorrowingSub + MachineWord, const N: usize, P: Personality> BorrowingSub for FixedUInt<T, N, P>
impl<T: ConstMachineWord + BorrowingSub + MachineWord, const N: usize, P: Personality> BorrowingSub for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + BorrowingSub + MachineWord, const N: usize, P: Personality> BorrowingSub for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + BorrowingSub + MachineWord, const N: usize, P: Personality> BorrowingSub for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Bounded for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Bounded for FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> Bounded for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> Bounded for FixedUInt<T, N, P>
num-traits only.Source§impl<T: ConstMachineWord + CarryingAdd + MachineWord, const N: usize, P: Personality> CarryingAdd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + CarryingAdd + MachineWord, const N: usize, P: Personality> CarryingAdd for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + CarryingAdd + MachineWord, const N: usize, P: Personality> CarryingAdd for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + CarryingAdd + MachineWord, const N: usize, P: Personality> CarryingAdd for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + CarryingAdd + BorrowingSub + MachineWord, const N: usize, P: Personality> CarryingMul for FixedUInt<T, N, P>
impl<T: ConstMachineWord + CarryingAdd + BorrowingSub + MachineWord, const N: usize, P: Personality> CarryingMul for FixedUInt<T, N, P>
Source§type Unsigned = FixedUInt<T, N, P>
type Unsigned = FixedUInt<T, N, P>
Self for unsigned types,
the unsigned counterpart for signed types (matching std’s
carrying_mul signatures).Source§fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)
fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)
self * rhs + carry without the
possibility to overflow, returning (low, high) words of the result. Read moreSource§fn carrying_mul_add(self, rhs: Self, addend: Self, carry: Self) -> (Self, Self)
fn carrying_mul_add(self, rhs: Self, addend: Self, carry: Self) -> (Self, Self)
self * rhs + carry + add
without the possibility to overflow, returning (low, high) words. Read moreSource§impl<T: ConstMachineWord + CarryingAdd + BorrowingSub + MachineWord, const N: usize, P: Personality> CarryingMul for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + CarryingAdd + BorrowingSub + MachineWord, const N: usize, P: Personality> CarryingMul for &FixedUInt<T, N, P>
Source§type Unsigned = FixedUInt<T, N, P>
type Unsigned = FixedUInt<T, N, P>
Self for unsigned types,
the unsigned counterpart for signed types (matching std’s
carrying_mul signatures).Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedAdd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedAdd for FixedUInt<T, N, P>
Source§fn checked_add(self, other: Self) -> Option<Self>
fn checked_add(self, other: Self) -> Option<Self>
None is
returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedAdd for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedAdd for &FixedUInt<T, N, P>
Source§fn checked_add(self, other: Self) -> Option<FixedUInt<T, N, P>>
fn checked_add(self, other: Self) -> Option<FixedUInt<T, N, P>>
None is
returned.Source§impl<T: MachineWord, const N: usize, P: Personality> CheckedAdd for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> CheckedAdd for FixedUInt<T, N, P>
num-traits only.Source§fn checked_add(&self, other: &Self) -> Option<Self>
fn checked_add(&self, other: &Self) -> Option<Self>
None is
returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N, Nct>
Source§fn checked_div(self, other: Self) -> Option<Self>
fn checked_div(self, other: Self) -> Option<Self>
None is returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedDiv for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedDiv for &FixedUInt<T, N, Nct>
Source§impl<T: MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N, Nct>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N, Nct>
num-traits only.Source§fn checked_div(&self, other: &Self) -> Option<Self>
fn checked_div(&self, other: &Self) -> Option<Self>
None is returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedEuclid for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedEuclid for FixedUInt<T, N, Nct>
Source§fn checked_div_euclid(self, v: Self) -> Option<Self>
fn checked_div_euclid(self, v: Self) -> Option<Self>
None on division by zero or if
overflow occurred.Source§fn checked_rem_euclid(self, v: Self) -> Option<Self>
fn checked_rem_euclid(self, v: Self) -> Option<Self>
None on
division by zero or if overflow occurred.Source§fn checked_div_rem_euclid(self, v: Self) -> Option<(Self, Self)>
fn checked_div_rem_euclid(self, v: Self) -> Option<(Self, Self)>
None on division by zero or if overflow occurred. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedEuclid for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedEuclid for &FixedUInt<T, N, Nct>
Source§fn checked_div_euclid(self, v: Self) -> Option<FixedUInt<T, N, Nct>>
fn checked_div_euclid(self, v: Self) -> Option<FixedUInt<T, N, Nct>>
None on division by zero or if
overflow occurred.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedMul for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedMul for FixedUInt<T, N, P>
Source§fn checked_mul(self, other: Self) -> Option<Self>
fn checked_mul(self, other: Self) -> Option<Self>
None is returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedMul for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedMul for &FixedUInt<T, N, P>
Source§fn checked_mul(self, other: Self) -> Option<FixedUInt<T, N, P>>
fn checked_mul(self, other: Self) -> Option<FixedUInt<T, N, P>>
None is returned.Source§impl<T: MachineWord, const N: usize, P: Personality> CheckedMul for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> CheckedMul for FixedUInt<T, N, P>
num-traits only.Source§fn checked_mul(&self, other: &Self) -> Option<Self>
fn checked_mul(&self, other: &Self) -> Option<Self>
None is returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedPow for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedPow for FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedPow for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedPow for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedRem for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedRem for FixedUInt<T, N, Nct>
Source§fn checked_rem(self, other: Self) -> Option<Self>
fn checked_rem(self, other: Self) -> Option<Self>
None is returned. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedRem for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> CheckedRem for &FixedUInt<T, N, Nct>
Source§impl<T: MachineWord, const N: usize> CheckedRem for FixedUInt<T, N, Nct>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize> CheckedRem for FixedUInt<T, N, Nct>
num-traits only.Source§fn checked_rem(&self, other: &Self) -> Option<Self>
fn checked_rem(&self, other: &Self) -> Option<Self>
None is returned. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShl for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShl for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShl for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShl for &FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> CheckedShl for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> CheckedShl for FixedUInt<T, N, P>
num-traits only.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShr for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShr for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShr for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedShr for &FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> CheckedShr for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> CheckedShr for FixedUInt<T, N, P>
num-traits only.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedSub for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedSub for FixedUInt<T, N, P>
Source§fn checked_sub(self, other: Self) -> Option<Self>
fn checked_sub(self, other: Self) -> Option<Self>
None is returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedSub for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> CheckedSub for &FixedUInt<T, N, P>
Source§fn checked_sub(self, other: Self) -> Option<FixedUInt<T, N, P>>
fn checked_sub(self, other: Self) -> Option<FixedUInt<T, N, P>>
None is returned.Source§impl<T: MachineWord, const N: usize, P: Personality> CheckedSub for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> CheckedSub for FixedUInt<T, N, P>
num-traits only.Source§fn checked_sub(&self, other: &Self) -> Option<Self>
fn checked_sub(&self, other: &Self) -> Option<Self>
None is returned.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Clone for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Clone for FixedUInt<T, N, P>
Source§impl<T: MachineWord + ConditionallySelectable, const N: usize> ConditionallySelectable for FixedUInt<T, N, Ct>
impl<T: MachineWord + ConditionallySelectable, const N: usize> ConditionallySelectable for FixedUInt<T, N, Ct>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ConstOne for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ConstOne for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ConstZero for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ConstZero for FixedUInt<T, N, P>
Source§impl<T: MachineWord + ConstantTimeEq, const N: usize> ConstantTimeEq for FixedUInt<T, N, Ct>
impl<T: MachineWord + ConstantTimeEq, const N: usize> ConstantTimeEq for FixedUInt<T, N, Ct>
Source§impl<T: MachineWord + ConstantTimeEq + ConstantTimeGreater, const N: usize> ConstantTimeGreater for FixedUInt<T, N, Ct>
impl<T: MachineWord + ConstantTimeEq + ConstantTimeGreater, const N: usize> ConstantTimeGreater for FixedUInt<T, N, Ct>
Source§impl<T: MachineWord + ConstantTimeEq + ConstantTimeGreater, const N: usize> ConstantTimeLess for FixedUInt<T, N, Ct>
impl<T: MachineWord + ConstantTimeEq + ConstantTimeGreater, const N: usize> ConstantTimeLess for FixedUInt<T, N, Ct>
impl<T, const N: usize, P: Copy + Personality> Copy for FixedUInt<T, N, P>where
T: MachineWord + Copy,
Source§impl<T: MachineWord, const N: usize, P: Personality> CtCheckedAdd for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> CtCheckedAdd for FixedUInt<T, N, P>
Source§impl<T, const N: usize, P: Personality> CtCheckedMul for FixedUInt<T, N, P>where
T: MachineWord,
impl<T, const N: usize, P: Personality> CtCheckedMul for FixedUInt<T, N, P>where
T: MachineWord,
Source§fn ct_checked_mul(&self, v: &Self) -> CtOption<Self>
fn ct_checked_mul(&self, v: &Self) -> CtOption<Self>
Source§impl<T: MachineWord, const N: usize, P: Personality> CtCheckedSub for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> CtCheckedSub for FixedUInt<T, N, P>
Source§fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>
fn ct_checked_sub(&self, v: &Self) -> CtOption<Self>
Source§impl<T, const N: usize, P: Personality> CtIsPowerOfTwo for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
impl<T, const N: usize, P: Personality> CtIsPowerOfTwo for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
Source§fn ct_is_power_of_two(&self) -> Choice
fn ct_is_power_of_two(&self) -> Choice
true if self is a power of two.Source§impl<T, const N: usize, P: Personality> CtIsZero for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
impl<T, const N: usize, P: Personality> CtIsZero for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
Source§fn ct_is_zero(&self) -> Choice
fn ct_is_zero(&self) -> Choice
Source§impl<T, const N: usize, P: Personality> CtNonZero for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
impl<T, const N: usize, P: Personality> CtNonZero for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
Source§fn into_nonzero_ct(self) -> CtOption<Self::NonZero>
fn into_nonzero_ct(self) -> CtOption<Self::NonZero>
None-masked when self == 0.Source§impl<T, const N: usize, P: Personality> CtParity for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
impl<T, const N: usize, P: Personality> CtParity for FixedUInt<T, N, P>where
T: MachineWord + ConstantTimeEq,
Source§fn ct_is_odd(&self) -> Choice
fn ct_is_odd(&self) -> Choice
LSB of word 0, masked through subtle::ConstantTimeEq against
ZERO. Same body for both personalities — under Nct, the
branchless form is still correct, just unnecessary for CT
hygiene; under Ct, this is the path that keeps the result
masked all the way to Odd::new_ct.
Source§fn ct_is_even(&self) -> Choice
fn ct_is_even(&self) -> Choice
true if self is even.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Default for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Default for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> DepositBits for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> DepositBits for FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> DepositBits for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> DepositBits for &FixedUInt<T, N, Nct>
Source§type Output = FixedUInt<T, N>
type Output = FixedUInt<T, N>
self into the positions
of the one-bits of mask (the PDEP operation). All other bits of the
result are zero. Like std, this is only provided for unsigned types. Read morefn deposit_bits(self, mask: Self) -> FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Div<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Div<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Div<&FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Div<&FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Div<FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Div<FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> DivAssign for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> DivAssign for FixedUInt<T, N, Nct>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize> DivAssign<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> DivAssign<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> DivNonZero for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> DivNonZero for FixedUInt<T, N, Nct>
Source§type Output = FixedUInt<T, N>
type Output = FixedUInt<T, N>
Output — the divisor is Self::NonZero, not
Self, so Div::Output cannot be reused.Source§fn div_nonzero(self, d: Self::NonZero) -> Self::Output
fn div_nonzero(self, d: Self::NonZero) -> Self::Output
self / d, infallibly.Source§fn rem_nonzero(self, d: Self::NonZero) -> Self::Output
fn rem_nonzero(self, d: Self::NonZero) -> Self::Output
self % d, infallibly.impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Eq for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Euclid for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Euclid for FixedUInt<T, N, Nct>
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: ConstMachineWord + MachineWord, const N: usize> Euclid for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Euclid for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> ExtractBits for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> ExtractBits for FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> ExtractBits for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> ExtractBits for &FixedUInt<T, N, Nct>
Source§impl<T: MachineWord, const N: usize> From<FixedUInt<T, N>> for FixedUInt<T, N, Ct>
Lossless conversion from Nct to Ct. Tightens the invariant
(declares that the value will be handled under the CT threat model going
forward). Bit representation is identical; this is a free reinterpretation.
impl<T: MachineWord, const N: usize> From<FixedUInt<T, N>> for FixedUInt<T, N, Ct>
Lossless conversion from Nct to Ct. Tightens the invariant
(declares that the value will be handled under the CT threat model going
forward). Bit representation is identical; this is a free reinterpretation.
Source§impl<T, const N: usize, P: Personality> From<[T; N]> for FixedUInt<T, N, P>where
T: MachineWord,
impl<T, const N: usize, P: Personality> From<[T; N]> for FixedUInt<T, N, P>where
T: MachineWord,
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u8> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u8> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u16> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u16> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u32> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u32> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u64> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> From<u64> for FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> FromByteSlice for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> FromByteSlice for FixedUInt<T, N, P>
Source§fn from_be_slice(bytes: &[u8]) -> Result<Self, ByteSliceError>
fn from_be_slice(bytes: &[u8]) -> Result<Self, ByteSliceError>
Source§fn from_le_slice(bytes: &[u8]) -> Result<Self, ByteSliceError>
fn from_le_slice(bytes: &[u8]) -> Result<Self, ByteSliceError>
Source§impl<T: MachineWord, const N: usize, P: Personality> FromPrimitive for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> FromPrimitive for FixedUInt<T, N, P>
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> FromStr for FixedUInt<T, N, Nct>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize> FromStr for FixedUInt<T, N, Nct>
num-traits only.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShl for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShl for FixedUInt<T, N, P>
Source§type Output = FixedUInt<T, N, P>
type Output = FixedUInt<T, N, P>
self (high word) with rhs (low
word), shifts the combination left by n, and returns the high word
— i.e. (self << n) | (rhs >> (BITS - n)). Like std, this is only
provided for unsigned types. Read morefn funnel_shl(self, rhs: Self, n: u32) -> Self
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShl for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShl for &FixedUInt<T, N, P>
Source§type Output = FixedUInt<T, N, P>
type Output = FixedUInt<T, N, P>
self (high word) with rhs (low
word), shifts the combination left by n, and returns the high word
— i.e. (self << n) | (rhs >> (BITS - n)). Like std, this is only
provided for unsigned types. Read morefn funnel_shl(self, rhs: Self, n: u32) -> FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShr for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShr for FixedUInt<T, N, P>
Source§type Output = FixedUInt<T, N, P>
type Output = FixedUInt<T, N, P>
self (high word) with rhs (low
word), shifts the combination right by n, and returns the low word
— i.e. (rhs >> n) | (self << (BITS - n)). Like std, this is only
provided for unsigned types. Read morefn funnel_shr(self, rhs: Self, n: u32) -> Self
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShr for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> FunnelShr for &FixedUInt<T, N, P>
Source§type Output = FixedUInt<T, N, P>
type Output = FixedUInt<T, N, P>
self (high word) with rhs (low
word), shifts the combination right by n, and returns the low word
— i.e. (rhs >> n) | (self << (BITS - n)). Like std, this is only
provided for unsigned types. Read morefn funnel_shr(self, rhs: Self, n: u32) -> FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> HasNonZero for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> HasNonZero for FixedUInt<T, N, P>
Source§type NonZero = NonZeroFixedUInt<T, N, P>
type NonZero = NonZeroFixedUInt<T, N, P>
Self (core::num::NonZero<Self> for primitives).Source§fn into_nonzero(self) -> Option<Self::NonZero>
fn into_nonzero(self) -> Option<Self::NonZero>
Some iff self != 0.Source§fn nonzero_get(nz: Self::NonZero) -> Self
fn nonzero_get(nz: Self::NonZero) -> Self
Source§impl<T: MachineWord, const N: usize, P: Personality> HasPersonality for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> HasPersonality for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> HighestOne for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> HighestOne for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> HighestOne for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> HighestOne for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Ilog for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Ilog for FixedUInt<T, N, Nct>
Source§fn ilog(self, base: Self) -> u32
fn ilog(self, base: Self) -> u32
base, rounded
down. Read moreSource§fn checked_ilog(self, base: Self) -> Option<u32>
fn checked_ilog(self, base: Self) -> Option<u32>
base, rounded
down, or None if the number is zero (or negative, for signed
types) or if base is less than 2.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Ilog for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Ilog for &FixedUInt<T, N, Nct>
Source§fn ilog(self, base: Self) -> u32
fn ilog(self, base: Self) -> u32
base, rounded
down. Read moreSource§fn checked_ilog(self, base: Self) -> Option<u32>
fn checked_ilog(self, base: Self) -> Option<u32>
base, rounded
down, or None if the number is zero (or negative, for signed
types) or if base is less than 2.Source§impl<T: MachineWord, const N: usize> Integer for FixedUInt<T, N, Nct>
impl<T: MachineWord, const N: usize> Integer for FixedUInt<T, N, Nct>
Source§fn divides(&self, other: &Self) -> bool
fn divides(&self, other: &Self) -> bool
Please use is_multiple_of instead
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsPowerOfTwo for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsPowerOfTwo for FixedUInt<T, N, P>
Source§fn is_power_of_two(self) -> bool
fn is_power_of_two(self) -> bool
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsPowerOfTwo for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsPowerOfTwo for &FixedUInt<T, N, P>
Source§fn is_power_of_two(self) -> bool
fn is_power_of_two(self) -> bool
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateHighestOne for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateHighestOne for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateHighestOne for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateHighestOne for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateLowestOne for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateLowestOne for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateLowestOne for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> IsolateLowestOne for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> LowestOne for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> LowestOne for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> LowestOne for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> LowestOne for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Midpoint for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Midpoint for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Midpoint for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Midpoint for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<&&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<&&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<&FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Mul<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> MulAssign for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> MulAssign for FixedUInt<T, N, P>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> MulAssign<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> MulAssign<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§fn mul_assign(&mut self, other: &FixedUInt<T, N, P>)
fn mul_assign(&mut self, other: &FixedUInt<T, N, P>)
*= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize> MultipleOf for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> MultipleOf for FixedUInt<T, N, Nct>
Source§fn is_multiple_of(self, rhs: Self) -> bool
fn is_multiple_of(self, rhs: Self) -> bool
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> MultipleOf for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> MultipleOf for &FixedUInt<T, N, Nct>
Source§fn is_multiple_of(self, rhs: Self) -> bool
fn is_multiple_of(self, rhs: Self) -> bool
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> NextMultipleOf for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> NextMultipleOf for FixedUInt<T, N, Nct>
Source§fn next_multiple_of(self, rhs: Self) -> Self
fn next_multiple_of(self, rhs: Self) -> Self
self that is
a multiple of rhs (for negative rhs on signed types: the closest
to negative infinity). Read moreSource§fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
self that is
a multiple of rhs, returning None if rhs is zero or the
operation would result in overflow.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> NextMultipleOf for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> NextMultipleOf for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> NextPowerOfTwo for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> NextPowerOfTwo for FixedUInt<T, N, P>
Source§type Output = FixedUInt<T, N, P>
type Output = FixedUInt<T, N, P>
self. Read moreSource§fn wrapping_next_power_of_two(self) -> Self
fn wrapping_next_power_of_two(self) -> Self
self,
or 0 if it doesn’t fit in the type (i.e. the result wraps to zero). Read morefn next_power_of_two(self) -> Self
Source§fn checked_next_power_of_two(self) -> Option<Self>
fn checked_next_power_of_two(self) -> Option<Self>
self,
or None if it doesn’t fit in the type. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> NextPowerOfTwo for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> NextPowerOfTwo for &FixedUInt<T, N, P>
Source§type Output = FixedUInt<T, N, P>
type Output = FixedUInt<T, N, P>
self. Read morefn next_power_of_two(self) -> FixedUInt<T, N, P>
Source§fn checked_next_power_of_two(self) -> Option<FixedUInt<T, N, P>>
fn checked_next_power_of_two(self) -> Option<FixedUInt<T, N, P>>
self,
or None if it doesn’t fit in the type. Read moreSource§fn wrapping_next_power_of_two(self) -> FixedUInt<T, N, P>
fn wrapping_next_power_of_two(self) -> FixedUInt<T, N, P>
self,
or 0 if it doesn’t fit in the type (i.e. the result wraps to zero). Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Not for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Not for FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize> Num for FixedUInt<T, N, Nct>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize> Num for FixedUInt<T, N, Nct>
num-traits only.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, P: Personality> NumCast for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> NumCast for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> One for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> One for FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> One for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> One for FixedUInt<T, N, P>
num-traits only.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Ord for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Ord for FixedUInt<T, N, P>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingAdd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingAdd for FixedUInt<T, N, P>
Source§fn overflowing_add(self, other: Self) -> (Self, bool)
fn overflowing_add(self, other: Self) -> (Self, bool)
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingAdd for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingAdd for &FixedUInt<T, N, P>
Source§fn overflowing_add(self, other: Self) -> (FixedUInt<T, N, P>, bool)
fn overflowing_add(self, other: Self) -> (FixedUInt<T, N, P>, bool)
Source§impl<T: MachineWord, const N: usize, P: Personality> OverflowingAdd for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> OverflowingAdd for FixedUInt<T, N, P>
num-traits only.Source§fn overflowing_add(&self, other: &Self) -> (Self, bool)
fn overflowing_add(&self, other: &Self) -> (Self, bool)
Source§impl<T: MachineWord, const N: usize, P: Personality> OverflowingMul for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> OverflowingMul for FixedUInt<T, N, P>
num-traits only.Source§fn overflowing_mul(&self, other: &Self) -> (Self, bool)
fn overflowing_mul(&self, other: &Self) -> (Self, bool)
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingMul for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingMul for FixedUInt<T, N, P>
Source§fn overflowing_mul(self, other: Self) -> (Self, bool)
fn overflowing_mul(self, other: Self) -> (Self, bool)
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingMul for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingMul for &FixedUInt<T, N, P>
Source§fn overflowing_mul(self, other: Self) -> (FixedUInt<T, N, P>, bool)
fn overflowing_mul(self, other: Self) -> (FixedUInt<T, N, P>, bool)
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShl for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShl for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShl for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShl for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShr for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShr for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShr for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingShr for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingSub for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingSub for FixedUInt<T, N, P>
Source§fn overflowing_sub(self, other: Self) -> (Self, bool)
fn overflowing_sub(self, other: Self) -> (Self, bool)
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingSub for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> OverflowingSub for &FixedUInt<T, N, P>
Source§fn overflowing_sub(self, other: Self) -> (FixedUInt<T, N, P>, bool)
fn overflowing_sub(self, other: Self) -> (FixedUInt<T, N, P>, bool)
Source§impl<T: MachineWord, const N: usize, P: Personality> OverflowingSub for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> OverflowingSub for FixedUInt<T, N, P>
num-traits only.Source§fn overflowing_sub(&self, other: &Self) -> (Self, bool)
fn overflowing_sub(&self, other: &Self) -> (Self, bool)
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Parity for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Parity for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PartialEq for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PartialEq for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PartialOrd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PartialOrd for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PowerOfTwoOps for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PowerOfTwoOps for FixedUInt<T, N, P>
Source§fn div_pow2(self, p: PowerOfTwo<Self>) -> Self
fn div_pow2(self, p: PowerOfTwo<Self>) -> Self
self / p, computed as self >> p.exp().Source§fn rem_pow2(self, p: PowerOfTwo<Self>) -> Self
fn rem_pow2(self, p: PowerOfTwo<Self>) -> Self
self % p, computed as self & ((1 << p.exp()) - 1).Source§fn is_multiple_of_pow2(self, p: PowerOfTwo<Self>) -> bool
fn is_multiple_of_pow2(self, p: PowerOfTwo<Self>) -> bool
self % p == 0, computed as a mask test (no division).Source§fn next_multiple_of_pow2(self, p: PowerOfTwo<Self>) -> Self
fn next_multiple_of_pow2(self, p: PowerOfTwo<Self>) -> Self
p that is >= self (“align up”), computed
branch-free as (self + mask) & !mask. Uses +, so it panics on
overflow in debug (and the const-eval form errors) when self is
within p of the maximum — use
checked_next_multiple_of_pow2
for untrusted input.Source§fn checked_next_multiple_of_pow2(self, p: PowerOfTwo<Self>) -> Option<Self>
fn checked_next_multiple_of_pow2(self, p: PowerOfTwo<Self>) -> Option<Self>
next_multiple_of_pow2, returning None
on overflow instead of panicking.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PrimBits for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> PrimBits for FixedUInt<T, N, P>
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 swap_bytes(self) -> Self
fn swap_bytes(self) -> Self
Source§fn rotate_left(self, n: u32) -> Self
fn rotate_left(self, n: u32) -> Self
n, wrapping
the truncated bits to the end of the resulting integer. Read moreSource§fn rotate_right(self, n: u32) -> Self
fn rotate_right(self, n: u32) -> Self
n, wrapping
the truncated bits to the beginning of the resulting integer. Read moreSource§fn unsigned_shl(self, n: u32) -> Self
fn unsigned_shl(self, n: u32) -> Self
n, filling
zeros in the least significant bits. Read moreSource§fn unsigned_shr(self, n: u32) -> Self
fn unsigned_shr(self, n: u32) -> Self
n, filling
zeros in the most significant bits. Read moreSource§fn signed_shl(self, n: u32) -> Self
fn signed_shl(self, n: u32) -> Self
n, filling
zeros in the least significant bits. Read moreSource§fn signed_shr(self, n: u32) -> Self
fn signed_shr(self, n: u32) -> Self
n, copying
the “sign bit” in the most significant bits even for unsigned types. Read moreSource§fn reverse_bits(self) -> Self
fn reverse_bits(self) -> Self
Source§fn from_be(x: Self) -> Self
fn from_be(x: Self) -> Self
Source§fn from_le(x: Self) -> Self
fn from_le(x: Self) -> Self
Source§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§impl<T: MachineWord, const N: usize> PrimInt for FixedUInt<T, N, Nct>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize> PrimInt for FixedUInt<T, N, Nct>
num-traits only.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, bits: u32) -> Self
fn signed_shl(self, bits: u32) -> Self
n, filling
zeros in the least significant bits. Read moreSource§fn signed_shr(self, bits: u32) -> Self
fn signed_shr(self, bits: 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, exp: u32) -> Self
fn pow(self, exp: 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, P: Personality> Product for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> Product for FixedUInt<T, N, P>
Source§impl<'a, T: MachineWord, const N: usize, P: Personality> Product<&'a FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<'a, T: MachineWord, const N: usize, P: Personality> Product<&'a FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Rem<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Rem<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Rem<&FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Rem<&FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> Rem<FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> Rem<FixedUInt<T, N>> for &FixedUInt<T, N, Nct>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> RemAssign for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> RemAssign for FixedUInt<T, N, Nct>
Source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
%= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize> RemAssign<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> RemAssign<&FixedUInt<T, N>> for FixedUInt<T, N, Nct>
Source§impl<T: MachineWord, const N: usize> Roots for FixedUInt<T, N, Nct>
impl<T: MachineWord, const N: usize> Roots for FixedUInt<T, N, Nct>
Source§impl<T: MachineWord, const N: usize, P: Personality> Saturating for FixedUInt<T, N, P>
Available on crate feature num-traits only.Note: This is marked deprecated, but still used by PrimInt
impl<T: MachineWord, const N: usize, P: Personality> Saturating for FixedUInt<T, N, P>
num-traits only.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
Source§fn saturating_sub(self, other: Self) -> Self
fn saturating_sub(self, other: Self) -> Self
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingAdd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingAdd for FixedUInt<T, N, P>
Source§fn saturating_add(self, other: Self) -> Self
fn saturating_add(self, other: Self) -> Self
self + other, saturating at the relevant high or low boundary of
the type.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingAdd for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingAdd for &FixedUInt<T, N, P>
Source§fn saturating_add(self, other: Self) -> FixedUInt<T, N, P>
fn saturating_add(self, other: Self) -> FixedUInt<T, N, P>
self + other, saturating at the relevant high or low boundary of
the type.Source§impl<T: MachineWord, const N: usize, P: Personality> SaturatingAdd for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> SaturatingAdd for FixedUInt<T, N, P>
num-traits only.Source§fn saturating_add(&self, other: &Self) -> Self
fn saturating_add(&self, other: &Self) -> Self
self + other, saturating at the relevant high or low boundary of
the type.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingMul for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingMul for FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingMul for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingMul for &FixedUInt<T, N, P>
Source§fn saturating_mul(self, other: Self) -> FixedUInt<T, N, P>
fn saturating_mul(self, other: Self) -> FixedUInt<T, N, P>
self * other, saturating at the relevant high or low boundary of
the type.Source§impl<T: MachineWord, const N: usize, P: Personality> SaturatingMul for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> SaturatingMul for FixedUInt<T, N, P>
num-traits only.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: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingSub for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingSub for FixedUInt<T, N, P>
Source§fn saturating_sub(self, other: Self) -> Self
fn saturating_sub(self, other: Self) -> Self
self - other, saturating at the relevant high or low boundary of
the type.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingSub for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SaturatingSub for &FixedUInt<T, N, P>
Source§fn saturating_sub(self, other: Self) -> FixedUInt<T, N, P>
fn saturating_sub(self, other: Self) -> FixedUInt<T, N, P>
self - other, saturating at the relevant high or low boundary of
the type.Source§impl<T: MachineWord, const N: usize, P: Personality> SaturatingSub for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> SaturatingSub for FixedUInt<T, N, P>
num-traits only.Source§fn saturating_sub(&self, other: &Self) -> Self
fn saturating_sub(&self, other: &Self) -> Self
self - other, saturating at the relevant high or low boundary of
the type.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&u32> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&u32> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&u32> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&u32> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&usize> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&usize> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<&usize> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<u32> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<u32> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<u32> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<u32> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<usize> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<usize> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shl<usize> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlAssign<&usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlAssign<&usize> for FixedUInt<T, N, P>
Source§fn shl_assign(&mut self, bits: &usize)
fn shl_assign(&mut self, bits: &usize)
<<= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlAssign<usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlAssign<usize> for FixedUInt<T, N, P>
Source§fn shl_assign(&mut self, bits: usize)
fn shl_assign(&mut self, bits: usize)
<<= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlExact for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlExact for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlExact for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShlExact for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&u32> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&u32> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&u32> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&u32> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&usize> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&usize> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<&usize> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<u32> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<u32> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<u32> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<u32> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<usize> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<usize> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Shr<usize> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrAssign<&usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrAssign<&usize> for FixedUInt<T, N, P>
Source§fn shr_assign(&mut self, bits: &usize)
fn shr_assign(&mut self, bits: &usize)
>>= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrAssign<usize> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrAssign<usize> for FixedUInt<T, N, P>
Source§fn shr_assign(&mut self, bits: usize)
fn shr_assign(&mut self, bits: usize)
>>= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrExact for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrExact for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrExact for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> ShrExact for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictAdd for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictAdd for FixedUInt<T, N, Nct>
Source§fn strict_add(self, v: Self) -> Self
fn strict_add(self, v: Self) -> Self
self + v, panicking on overflow regardless
of whether overflow checks are enabled. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictDiv for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictDiv for FixedUInt<T, N, Nct>
Source§fn strict_div(self, v: Self) -> Self
fn strict_div(self, v: Self) -> Self
self / v, panicking on overflow (only
possible for MIN / -1 on a signed type) or if v is zero.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictDiv for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictDiv for &FixedUInt<T, N, Nct>
Source§fn strict_div(self, v: Self) -> FixedUInt<T, N, Nct>
fn strict_div(self, v: Self) -> FixedUInt<T, N, Nct>
self / v, panicking on overflow (only
possible for MIN / -1 on a signed type) or if v is zero.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictMul for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictMul for FixedUInt<T, N, Nct>
Source§fn strict_mul(self, v: Self) -> Self
fn strict_mul(self, v: Self) -> Self
self * v, panicking on overflow
regardless of whether overflow checks are enabled.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictMul for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictMul for &FixedUInt<T, N, Nct>
Source§fn strict_mul(self, v: Self) -> FixedUInt<T, N, Nct>
fn strict_mul(self, v: Self) -> FixedUInt<T, N, Nct>
self * v, panicking on overflow
regardless of whether overflow checks are enabled.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictPow for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictPow for FixedUInt<T, N, Nct>
Source§fn strict_pow(self, exp: u32) -> Self
fn strict_pow(self, exp: u32) -> Self
self.pow(exp), panicking on
overflow regardless of whether overflow checks are enabled.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictRem for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictRem for FixedUInt<T, N, Nct>
Source§fn strict_rem(self, v: Self) -> Self
fn strict_rem(self, v: Self) -> Self
self % v, panicking on overflow (only
possible for MIN % -1 on a signed type) or if v is zero.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictRem for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictRem for &FixedUInt<T, N, Nct>
Source§fn strict_rem(self, v: Self) -> FixedUInt<T, N, Nct>
fn strict_rem(self, v: Self) -> FixedUInt<T, N, Nct>
self % v, panicking on overflow (only
possible for MIN % -1 on a signed type) or if v is zero.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictShl for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictShl for FixedUInt<T, N, Nct>
Source§fn strict_shl(self, rhs: u32) -> Self
fn strict_shl(self, rhs: u32) -> Self
self << rhs, panicking if rhs is
larger than or equal to the number of bits in self.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictShr for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictShr for FixedUInt<T, N, Nct>
Source§fn strict_shr(self, rhs: u32) -> Self
fn strict_shr(self, rhs: u32) -> Self
self >> rhs, panicking if rhs is
larger than or equal to the number of bits in self.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictSub for FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictSub for FixedUInt<T, N, Nct>
Source§fn strict_sub(self, v: Self) -> Self
fn strict_sub(self, v: Self) -> Self
self - v, panicking on overflow
regardless of whether overflow checks are enabled.Source§impl<T: ConstMachineWord + MachineWord, const N: usize> StrictSub for &FixedUInt<T, N, Nct>
impl<T: ConstMachineWord + MachineWord, const N: usize> StrictSub for &FixedUInt<T, N, Nct>
Source§fn strict_sub(self, v: Self) -> FixedUInt<T, N, Nct>
fn strict_sub(self, v: Self) -> FixedUInt<T, N, Nct>
self - v, panicking on overflow
regardless of whether overflow checks are enabled.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Sub<FixedUInt<T, N, P>> for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SubAssign for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SubAssign for FixedUInt<T, N, P>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-= operation. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SubAssign<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> SubAssign<&FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
-= operation. Read moreSource§impl<T: MachineWord, const N: usize, P: Personality> Sum for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> Sum for FixedUInt<T, N, P>
Source§impl<'a, T: MachineWord, const N: usize, P: Personality> Sum<&'a FixedUInt<T, N, P>> for FixedUInt<T, N, P>
impl<'a, T: MachineWord, const N: usize, P: Personality> Sum<&'a FixedUInt<T, N, P>> for FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> ToPrimitive for FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize, P: Personality> ToPrimitive for FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShl for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShl for FixedUInt<T, N, P>
Source§fn unbounded_shl(self, rhs: u32) -> Self
fn unbounded_shl(self, rhs: u32) -> Self
self << rhs, without bounding the
value of rhs: if rhs >= BITS the entire value is shifted out and
0 is returned. Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShl for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShl for &FixedUInt<T, N, P>
Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShr for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShr for FixedUInt<T, N, P>
Source§fn unbounded_shr(self, rhs: u32) -> Self
fn unbounded_shr(self, rhs: u32) -> Self
self >> rhs, without bounding the
value of rhs: if rhs >= BITS, unsigned values become 0 and signed
values become 0 or -1 depending on the sign (the sign bit fills every
position). Read moreSource§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShr for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> UnboundedShr for &FixedUInt<T, N, P>
impl<T: MachineWord, const N: usize> Unsigned for FixedUInt<T, N, Nct>
num-traits only.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingAdd for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingAdd for FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingAdd for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingAdd for &FixedUInt<T, N, P>
Source§fn wrapping_add(self, other: Self) -> FixedUInt<T, N, P>
fn wrapping_add(self, other: Self) -> FixedUInt<T, N, P>
self + other, wrapping around at the boundary of
the type.Source§impl<T: MachineWord, const N: usize, P: Personality> WrappingAdd for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> WrappingAdd for FixedUInt<T, N, P>
num-traits only.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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingMul for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingMul for FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingMul for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingMul for &FixedUInt<T, N, P>
Source§fn wrapping_mul(self, other: Self) -> FixedUInt<T, N, P>
fn wrapping_mul(self, other: Self) -> FixedUInt<T, N, P>
self * other, wrapping around at the boundary
of the type.Source§impl<T: MachineWord, const N: usize, P: Personality> WrappingMul for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> WrappingMul for FixedUInt<T, N, P>
num-traits only.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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShl for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShl for FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShl for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShl for &FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> WrappingShl for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> WrappingShl for FixedUInt<T, N, P>
num-traits only.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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShr for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShr for FixedUInt<T, N, P>
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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShr for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingShr for &FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> WrappingShr for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> WrappingShr for FixedUInt<T, N, P>
num-traits only.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: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingSub for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingSub for FixedUInt<T, N, P>
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.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingSub for &FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> WrappingSub for &FixedUInt<T, N, P>
Source§fn wrapping_sub(self, other: Self) -> FixedUInt<T, N, P>
fn wrapping_sub(self, other: Self) -> FixedUInt<T, N, P>
self - other, wrapping around at the boundary
of the type.Source§impl<T: MachineWord, const N: usize, P: Personality> WrappingSub for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> WrappingSub for FixedUInt<T, N, P>
num-traits only.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.Source§impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Zero for FixedUInt<T, N, P>
impl<T: ConstMachineWord + MachineWord, const N: usize, P: Personality> Zero for FixedUInt<T, N, P>
Source§impl<T: MachineWord, const N: usize, P: Personality> Zero for FixedUInt<T, N, P>
Available on crate feature num-traits only.
impl<T: MachineWord, const N: usize, P: Personality> Zero for FixedUInt<T, N, P>
num-traits only.Auto Trait Implementations§
impl<T, const N: usize, P> Freeze for FixedUInt<T, N, P>where
T: Freeze,
impl<T, const N: usize, P> RefUnwindSafe for FixedUInt<T, N, P>where
T: RefUnwindSafe,
impl<T, const N: usize, P> Send for FixedUInt<T, N, P>where
T: Send,
impl<T, const N: usize, P> Sync for FixedUInt<T, N, P>where
T: Sync,
impl<T, const N: usize, P> Unpin for FixedUInt<T, N, P>where
T: Unpin,
impl<T, const N: usize, P> UnsafeUnpin for FixedUInt<T, N, P>where
T: UnsafeUnpin,
impl<T, const N: usize, P> UnwindSafe for FixedUInt<T, N, P>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.