Struct fixed_bigint::fixeduint::FixedUInt [−][src]
Fixed-size unsigned integer, represented by array of N words of builtin unsigned type T
Implementations
impl<T: MachineWord, const N: usize> FixedUInt<T, N>
[src]
pub fn new() -> FixedUInt<T, N>
[src]
Creates and zero-initializes a FixedUInt.
pub fn bit_length(&self) -> u32
[src]
Returns number of used bits.
pub fn div_rem(&self, divisor: &Self) -> (Self, Self)
[src]
Performs a division, returning both the quotient and reminder in a tuple.
pub fn from_le_bytes(bytes: &[u8]) -> Self
[src]
Create a little-endian integer value from its representation as a byte array in little endian.
pub fn to_hex_str<'a>(&self, result: &'a mut [u8]) -> Result<&'a str, Error>
[src]
Converts to hex string, given a buffer.
Trait Implementations
impl<T: MachineWord, const N: usize> Add<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
impl<T: MachineWord, const N: usize> BitAnd<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> BitOr<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> BitXor<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, other: Self) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> Bounded for FixedUInt<T, N>
[src]
impl<T: MachineWord, const N: usize> CheckedAdd for FixedUInt<T, N>
[src]
fn checked_add(&self, other: &Self) -> Option<Self>
[src]
impl<T: MachineWord, const N: usize> CheckedDiv for FixedUInt<T, N>
[src]
fn checked_div(&self, _: &Self) -> Option<Self>
[src]
impl<T: MachineWord, const N: usize> CheckedMul for FixedUInt<T, N>
[src]
fn checked_mul(&self, _: &Self) -> Option<Self>
[src]
impl<T: MachineWord, const N: usize> CheckedSub for FixedUInt<T, N>
[src]
fn checked_sub(&self, other: &Self) -> Option<Self>
[src]
impl<T: Clone, const N: usize> Clone for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
fn clone(&self) -> FixedUInt<T, N>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy, const N: usize> Copy for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
impl<T: Debug, const N: usize> Debug for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
impl<T: MachineWord, const N: usize> Default for FixedUInt<T, N>
[src]
impl<T: MachineWord, const N: usize> Div<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
impl<T: Eq, const N: usize> Eq for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
impl<T: MachineWord, const N: usize> From<u16> for FixedUInt<T, N>
[src]
impl<T: MachineWord, const N: usize> From<u32> for FixedUInt<T, N>
[src]
impl<T: MachineWord, const N: usize> From<u64> for FixedUInt<T, N>
[src]
impl<T: MachineWord, const N: usize> From<u8> for FixedUInt<T, N>
[src]
impl<T: MachineWord, const N: usize> FromPrimitive for FixedUInt<T, N>
[src]
fn from_i64(_: i64) -> Option<Self>
[src]
fn from_u64(input: u64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_i128(n: i128) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
pub fn from_u128(n: u128) -> Option<Self>
[src]
pub fn from_f32(n: f32) -> Option<Self>
[src]
pub fn from_f64(n: f64) -> Option<Self>
[src]
impl<T: MachineWord, const N: usize> LowerHex for FixedUInt<T, N> where
u8: TryFrom<T>,
[src]
u8: TryFrom<T>,
impl<T: MachineWord, const N: usize> Mul<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> Not for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> Num for FixedUInt<T, N>
[src]
type FromStrRadixErr = ParseIntError
fn from_str_radix(
input: &str,
radix: u32
) -> Result<Self, Self::FromStrRadixErr>
[src]
input: &str,
radix: u32
) -> Result<Self, Self::FromStrRadixErr>
impl<T: MachineWord, const N: usize> NumCast for FixedUInt<T, N>
[src]
fn from<X>(_: X) -> Option<Self> where
T: ToPrimitive,
[src]
T: ToPrimitive,
impl<T: MachineWord, const N: usize> One for FixedUInt<T, N>
[src]
fn one() -> Self
[src]
pub fn set_one(&mut self)
[src]
pub fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
Self: PartialEq<Self>,
impl<T: MachineWord, const N: usize> Ord for FixedUInt<T, N>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: MachineWord, const N: usize> OverflowingAdd for FixedUInt<T, N>
[src]
fn overflowing_add(&self, other: &Self) -> (Self, bool)
[src]
impl<T: MachineWord, const N: usize> OverflowingSub for FixedUInt<T, N>
[src]
fn overflowing_sub(&self, other: &Self) -> (Self, bool)
[src]
impl<T: PartialEq, const N: usize> PartialEq<FixedUInt<T, N>> for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
fn eq(&self, other: &FixedUInt<T, N>) -> bool
[src]
fn ne(&self, other: &FixedUInt<T, N>) -> bool
[src]
impl<T: MachineWord, const N: usize> PartialOrd<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: MachineWord, const N: usize> PrimInt for FixedUInt<T, N>
[src]
fn count_ones(self) -> u32
[src]
fn count_zeros(self) -> u32
[src]
fn leading_zeros(self) -> u32
[src]
fn trailing_zeros(self) -> u32
[src]
fn rotate_left(self, _: u32) -> Self
[src]
fn rotate_right(self, _: u32) -> Self
[src]
fn signed_shl(self, _: u32) -> Self
[src]
fn signed_shr(self, _: u32) -> Self
[src]
fn unsigned_shl(self, _: u32) -> Self
[src]
fn unsigned_shr(self, _: u32) -> Self
[src]
fn swap_bytes(self) -> Self
[src]
fn from_be(_: Self) -> Self
[src]
fn from_le(_: Self) -> Self
[src]
fn to_be(self) -> Self
[src]
fn to_le(self) -> Self
[src]
fn pow(self, _: u32) -> Self
[src]
impl<T: MachineWord, const N: usize> Rem<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, other: Self) -> Self
[src]
impl<T: MachineWord, const N: usize> Saturating for FixedUInt<T, N>
[src]
Note: This is marked deprecated, but still used by PrimInt
fn saturating_add(self, other: Self) -> Self
[src]
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
fn saturating_sub(self, other: Self) -> Self
[src]
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
impl<T: MachineWord, const N: usize> SaturatingAdd for FixedUInt<T, N>
[src]
fn saturating_add(&self, other: &Self) -> Self
[src]
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
impl<T: MachineWord, const N: usize> SaturatingSub for FixedUInt<T, N>
[src]
fn saturating_sub(&self, other: &Self) -> Self
[src]
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
impl<T: MachineWord, const N: usize> Shl<usize> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the <<
operator.
fn shl(self, bits: usize) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> Shr<usize> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the >>
operator.
fn shr(self, bits: usize) -> Self::Output
[src]
impl<T, const N: usize> StructuralEq for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
impl<T, const N: usize> StructuralPartialEq for FixedUInt<T, N> where
T: MachineWord,
[src]
T: MachineWord,
impl<T: MachineWord, const N: usize> Sub<FixedUInt<T, N>> for FixedUInt<T, N>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<T: MachineWord, const N: usize> ToPrimitive for FixedUInt<T, N>
[src]
fn to_i64(&self) -> Option<i64>
[src]
fn to_u64(&self) -> Option<u64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_i128(&self) -> Option<i128>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_u128(&self) -> Option<u128>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
pub fn to_f64(&self) -> Option<f64>
[src]
impl<T: MachineWord, const N: usize> UpperHex for FixedUInt<T, N> where
u8: TryFrom<T>,
[src]
u8: TryFrom<T>,
impl<T: MachineWord, const N: usize> WrappingAdd for FixedUInt<T, N>
[src]
fn wrapping_add(&self, other: &Self) -> Self
[src]
impl<T: MachineWord, const N: usize> WrappingSub for FixedUInt<T, N>
[src]
fn wrapping_sub(&self, other: &Self) -> Self
[src]
impl<T: MachineWord, const N: usize> Zero for FixedUInt<T, N>
[src]
Auto Trait Implementations
impl<T, const N: usize> Send for FixedUInt<T, N> where
T: Send,
T: Send,
impl<T, const N: usize> Sync for FixedUInt<T, N> where
T: Sync,
T: Sync,
impl<T, const N: usize> Unpin for FixedUInt<T, N> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,