Uint

Trait Uint 

Source
pub trait Uint:
    Sized
    + Clone
    + Copy
    + Default
    + PartialEq
    + Eq
    + PartialOrd
    + Ord
    + From<bool>
    + From<u8>
    + From<u16>
    + From<u32>
    + From<u64>
    + From<u128>
    + From<i8>
    + From<i16>
    + From<i32>
    + From<i64>
    + From<i128>
    + TryInto<bool>
    + TryInto<u8>
    + TryInto<u16>
    + TryInto<u32>
    + TryInto<u64>
    + TryInto<u128>
    + TryInto<i8>
    + TryInto<i16>
    + TryInto<i32>
    + TryInto<i64>
    + TryInto<i128>
    + Hash
    + FromStr
    + From<&'static str>
    + Borsh {
    type Inner: AsMut<[u64]> + AsRef<[u64]> + Copy + Clone + Default + Sized;

    const MAX: Self;
    const ZERO: Self;
    const ONE: Self;
    const NUM_WORDS: usize;
    const WORD_BITS: usize;
Show 57 methods // Required methods fn into_inner(self) -> Self::Inner; fn as_inner(&self) -> &Self::Inner; fn as_inner_mut(&mut self) -> &mut Self::Inner; fn put_big_endian(&self, bytes: &mut [u8]); fn put_little_endian(&self, bytes: &mut [u8]); fn to_big_endian(&self) -> Vec<u8> ; fn to_little_endian(&self) -> Vec<u8> ; fn from_big_endian(slice: &[u8]) -> Self; fn from_little_endian(slice: &[u8]) -> Self; fn as_u64(&self) -> u64; fn low_u64(&self) -> u64; fn from_u64(v: u64) -> Self; fn is_zero(&self) -> bool; fn bits(&self) -> usize; fn leading_zeros(&self) -> u32; fn trailing_zeros(&self) -> u32; fn div_mod(self, other: Self) -> (Self, Self); fn overflowing_add(self, other: Self) -> (Self, bool); fn overflowing_sub(self, other: Self) -> (Self, bool); fn overflowing_mul_u64(self, other: u64) -> (Self, u64); fn overflowing_mul(self, other: Self) -> (Self, bool); fn overflowing_not(self) -> (Self, bool); fn overflowing_bitand(self, other: Self) -> (Self, bool); fn overflowing_bitor(self, other: Self) -> (Self, bool); fn overflowing_bitxor(self, other: Self) -> (Self, bool); fn overflowing_neg(self) -> (Self, bool); fn overflowing_shr(self, other: u32) -> (Self, bool); fn overflowing_shl(self, other: u32) -> (Self, bool); fn wrapping_cmp(&self, other: &Self) -> Ordering; // Provided methods fn max_value() -> Self { ... } fn min_value() -> Self { ... } fn is_even(&self) -> bool { ... } fn is_odd(&self) -> bool { ... } fn bit(&self, n: usize) -> bool { ... } fn overflowing_pow<S: BitIterBE>(self, exp: S) -> (Self, bool) { ... } fn to_other<U: Uint>(self) -> Option<U> { ... } fn unchecked_pow(self, other: Self) -> Self { ... } fn unchecked_add(self, other: Self) -> Self { ... } fn unchecked_sub(self, other: Self) -> Self { ... } fn unchecked_mul(self, other: Self) -> Self { ... } fn overflowing_div(self, other: Self) -> (Self, bool) { ... } fn unchecked_div(self, other: Self) -> Self { ... } fn overflowing_rem(self, other: Self) -> (Self, bool) { ... } fn unchecked_rem(self, other: Self) -> Self { ... } fn unchecked_neg(self) -> Self { ... } fn unchecked_shr(self, rhs: u32) -> Self { ... } fn unchecked_shl(self, lhs: u32) -> Self { ... } fn wrapping_pow(self, other: Self) -> Self { ... } fn wrapping_add(self, other: Self) -> Self { ... } fn wrapping_sub(self, other: Self) -> Self { ... } fn wrapping_mul(self, other: Self) -> Self { ... } fn wrapping_div(self, other: Self) -> Self { ... } fn wrapping_rem(self, other: Self) -> Self { ... } fn wrapping_shl(self, other: u32) -> Self { ... } fn wrapping_shr(self, other: u32) -> Self { ... } fn wrapping_neg(self) -> Self { ... } fn wrapping_not(self) -> Self { ... }
}

Required Associated Constants§

Source

const MAX: Self

Source

const ZERO: Self

Source

const ONE: Self

Source

const NUM_WORDS: usize

Source

const WORD_BITS: usize

Required Associated Types§

Required Methods§

Source

fn into_inner(self) -> Self::Inner

Source

fn as_inner(&self) -> &Self::Inner

Source

fn as_inner_mut(&mut self) -> &mut Self::Inner

Source

fn put_big_endian(&self, bytes: &mut [u8])

Source

fn put_little_endian(&self, bytes: &mut [u8])

Source

fn to_big_endian(&self) -> Vec<u8>

Source

fn to_little_endian(&self) -> Vec<u8>

Source

fn from_big_endian(slice: &[u8]) -> Self

Source

fn from_little_endian(slice: &[u8]) -> Self

Source

fn as_u64(&self) -> u64

Source

fn low_u64(&self) -> u64

Source

fn from_u64(v: u64) -> Self

Source

fn is_zero(&self) -> bool

Source

fn bits(&self) -> usize

Source

fn leading_zeros(&self) -> u32

Source

fn trailing_zeros(&self) -> u32

Source

fn div_mod(self, other: Self) -> (Self, Self)

Source

fn overflowing_add(self, other: Self) -> (Self, bool)

Source

fn overflowing_sub(self, other: Self) -> (Self, bool)

Source

fn overflowing_mul_u64(self, other: u64) -> (Self, u64)

Source

fn overflowing_mul(self, other: Self) -> (Self, bool)

Source

fn overflowing_not(self) -> (Self, bool)

Source

fn overflowing_bitand(self, other: Self) -> (Self, bool)

Source

fn overflowing_bitor(self, other: Self) -> (Self, bool)

Source

fn overflowing_bitxor(self, other: Self) -> (Self, bool)

Source

fn overflowing_neg(self) -> (Self, bool)

Source

fn overflowing_shr(self, other: u32) -> (Self, bool)

Source

fn overflowing_shl(self, other: u32) -> (Self, bool)

Source

fn wrapping_cmp(&self, other: &Self) -> Ordering

Provided Methods§

Source

fn max_value() -> Self

Source

fn min_value() -> Self

Source

fn is_even(&self) -> bool

Source

fn is_odd(&self) -> bool

Source

fn bit(&self, n: usize) -> bool

Source

fn overflowing_pow<S: BitIterBE>(self, exp: S) -> (Self, bool)

Source

fn to_other<U: Uint>(self) -> Option<U>

Source

fn unchecked_pow(self, other: Self) -> Self

Source

fn unchecked_add(self, other: Self) -> Self

Source

fn unchecked_sub(self, other: Self) -> Self

Source

fn unchecked_mul(self, other: Self) -> Self

Source

fn overflowing_div(self, other: Self) -> (Self, bool)

Checked division. Returns None if other == 0.

Source

fn unchecked_div(self, other: Self) -> Self

Source

fn overflowing_rem(self, other: Self) -> (Self, bool)

Source

fn unchecked_rem(self, other: Self) -> Self

Source

fn unchecked_neg(self) -> Self

Source

fn unchecked_shr(self, rhs: u32) -> Self

Source

fn unchecked_shl(self, lhs: u32) -> Self

Source

fn wrapping_pow(self, other: Self) -> Self

Source

fn wrapping_add(self, other: Self) -> Self

Source

fn wrapping_sub(self, other: Self) -> Self

Source

fn wrapping_mul(self, other: Self) -> Self

Source

fn wrapping_div(self, other: Self) -> Self

Source

fn wrapping_rem(self, other: Self) -> Self

Source

fn wrapping_shl(self, other: u32) -> Self

Source

fn wrapping_shr(self, other: u32) -> Self

Source

fn wrapping_neg(self) -> Self

Source

fn wrapping_not(self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§