Skip to main content

BUint

Struct BUint 

Source
pub struct BUint<const N: usize> { /* private fields */ }
Expand description

Unsigned integer type composed of u64 digits, of arbitrary fixed size which must be known at compile time.

Digits are stored in little endian (least significant digit first). This integer type aims to exactly replicate the behaviours of Rust’s built-in unsigned integer types: u8, u16, u32, u64, u128 and usize. The const generic parameter N is the number of u64 digits that are stored.

BUint implements all the arithmetic traits from the core::ops module. The behaviour of the implementation of these traits is the same as for Rust’s primitive integers - i.e. in debug mode it panics on overflow, and in release mode it performs two’s complement wrapping (see https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-overflow). However, an attempt to divide by zero or calculate a remainder with a divisor of zero will always panic, unless the checked_ methods are used, which never panic.

Implementations§

Source§

impl<const N: usize> BUint<N>

Bigint helper methods: common functions used to implement big integer arithmetic.

Source

pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)

Source

pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Source

pub const fn widening_mul(self, rhs: Self) -> (Self, Self)

Source

pub const fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Source§

impl<const N: usize> BUint<N>

Checked arithmetic methods which act on self: self.checked_.... Each method cannot panic and returns an Option<Self>. None is returned when overflow would have occurred or there was an attempt to divide by zero or calculate a remainder with a divisor of zero.

Source

pub const fn checked_add(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_add_signed(self, rhs: BInt<N>) -> Option<Self>

Source

pub const fn checked_sub(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_mul(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_div(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_div_euclid(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_rem(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_rem_euclid(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_neg(self) -> Option<Self>

Source

pub const fn checked_shl(self, rhs: u32) -> Option<Self>

Source

pub const fn checked_shr(self, rhs: u32) -> Option<Self>

Source

pub const fn checked_pow(self, pow: u32) -> Option<Self>

Source

pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Source

pub const fn checked_ilog2(self) -> Option<u32>

Source

pub const fn checked_ilog10(self) -> Option<u32>

Source

pub const fn checked_ilog(self, base: Self) -> Option<u32>

Source

pub const fn checked_next_power_of_two(self) -> Option<Self>

Returns the smallest power of two greater than or equal to self. If the next power of two is greater than Self::MAX, None is returned, otherwise the power of two is wrapped in Some.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.checked_next_power_of_two.

§Examples
use bnum::types::U256;

let n = U256::from(2u8);
assert_eq!(n.checked_next_power_of_two(), Some(n));
let m = U256::from(3u8);
assert_eq!(U256::MAX.checked_next_power_of_two(), None);
Source§

impl<const N: usize> BUint<N>

The latest version of the nightly Rust compiler at the time v0.7.0 was published (v1.71.0-nightly) unfortunately dropped support for the const implementation of common standard library traits such as Add, BitOr, etc. These methods below have therefore been provided to allow use of some of the methods these traits provided, in a const context.

Source

pub const fn bitand(self, rhs: Self) -> Self

Source

pub const fn bitor(self, rhs: Self) -> Self

Source

pub const fn bitxor(self, rhs: Self) -> Self

Source

pub const fn not(self) -> Self

Source

pub const fn eq(&self, other: &Self) -> bool

Source

pub const fn ne(&self, other: &Self) -> bool

Source

pub const fn cmp(&self, other: &Self) -> Ordering

Source

pub const fn max(self, other: Self) -> Self

Source

pub const fn min(self, other: Self) -> Self

Source

pub const fn clamp(self, min: Self, max: Self) -> Self

Source

pub const fn lt(&self, other: &Self) -> bool

Source

pub const fn le(&self, other: &Self) -> bool

Source

pub const fn gt(&self, other: &Self) -> bool

Source

pub const fn ge(&self, other: &Self) -> bool

Source

pub const fn add(self, rhs: Self) -> Self

Source

pub const fn mul(self, rhs: Self) -> Self

Source

pub const fn shl(self, rhs: u32) -> Self

Source

pub const fn shr(self, rhs: u32) -> Self

Source

pub const fn sub(self, rhs: Self) -> Self

Source

pub const fn div(self, rhs: Self) -> Self

Source

pub const fn rem(self, rhs: Self) -> Self

Source§

impl<const N: usize> BUint<N>

Associated constants for this type.

Source

pub const MIN: Self

The minimum value that this type can represent.

§Examples
use bnum::types::U512;

assert_eq!(!U512::MIN, U512::MAX);
Source

pub const MAX: Self

The maximum value that this type can represent.

§Examples
use bnum::types::U512;

assert_eq!(U512::MAX.wrapping_add(U512::ONE), U512::MIN);
Source

pub const BITS: u32

The total number of bits that this type contains.

§Examples
use bnum::types::U512;

assert_eq!(U512::BITS, 512);
Source

pub const BYTES: u32

The total number of bytes that this type contains.

§Examples
use bnum::types::U512;

assert_eq!(U512::BYTES, 512 / 8);
Source

pub const ZERO: Self = Self::MIN

The value of 0 represented by this type.

§Examples
use bnum::types::U512;

assert_eq!(U512::ZERO, U512::from(0u8));
Source

pub const ONE: Self

The value of 1 represented by this type.

Source

pub const TWO: Self

The value of 2 represented by this type.

Source

pub const THREE: Self

The value of 3 represented by this type.

Source

pub const FOUR: Self

The value of 4 represented by this type.

Source

pub const FIVE: Self

The value of 5 represented by this type.

Source

pub const SIX: Self

The value of 6 represented by this type.

Source

pub const SEVEN: Self

The value of 7 represented by this type.

Source

pub const EIGHT: Self

The value of 8 represented by this type.

Source

pub const NINE: Self

The value of 9 represented by this type.

Source

pub const TEN: Self

The value of 10 represented by this type.

Source§

impl<const N: usize> BUint<N>

Methods which convert a BUint to and from data stored in different endianness.

Source

pub const fn from_be(x: Self) -> Self

Converts an integer from big endian to the target’s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.from_be.

Source

pub const fn from_le(x: Self) -> Self

Converts an integer from little endian to the target’s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.from_le.

Source

pub const fn to_be(self) -> Self

Converts self from big endian to the target’s endianness.

On big endian this is a no-op. On little endian the bytes are swapped.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.to_be.

Source

pub const fn to_le(self) -> Self

Converts self from little endian to the target’s endianness.

On little endian this is a no-op. On big endian the bytes are swapped.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.to_le.

Source

pub const fn from_be_slice(slice: &[u8]) -> Option<Self>

Create an integer value from a slice of bytes in big endian. The value is wrapped in an Option as the integer represented by the slice of bytes may represent an integer too large to be represented by the type.

If the length of the slice is shorter than Self::BYTES, the slice is padded with zeros at the start so that it’s length equals Self::BYTES.

If the length of the slice is longer than Self::BYTES, None will be returned, unless leading zeros from the slice can be removed until the length of the slice equals Self::BYTES.

§Examples
use bnum::types::U128;

let value_from_array = U128::from(u128::from_be_bytes([0, 0, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]));
// using the `from_be_bytes` method on the primitve `u128` here instead of on `U128` as `from_be_bytes` is currently only available in bnum on nightly
let value_from_slice = U128::from_be_slice(&[0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]).unwrap();
let value_from_long_slice = U128::from_be_slice(&[0, 0, 0, 0, 0, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]).unwrap();

assert_eq!(value_from_array, value_from_slice);
assert_eq!(value_from_array, value_from_long_slice);

let invalid_slice = &[0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90];
assert_eq!(U128::from_be_slice(invalid_slice), None);
Source

pub const fn from_le_slice(slice: &[u8]) -> Option<Self>

Creates an integer value from a slice of bytes in little endian. The value is wrapped in an Option as the bytes may represent an integer too large to be represented by the type.

If the length of the slice is shorter than Self::BYTES, the slice is padded with zeros at the end so that it’s length equals Self::BYTES.

If the length of the slice is longer than Self::BYTES, None will be returned, unless trailing zeros from the slice can be removed until the length of the slice equals Self::BYTES.

§Examples
use bnum::types::U128;

let value_from_array = U128::from(u128::from_le_bytes([0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0, 0]));
// using the `from_le_bytes` method on the primitve `u128` here instead of on `U128` as `from_le_bytes` is currently only available in bnum on nightly
let value_from_slice = U128::from_le_slice(&[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56]).unwrap();
let value_from_long_slice = U128::from_le_slice(&[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0, 0, 0, 0, 0, 0]).unwrap();

assert_eq!(value_from_array, value_from_slice);
assert_eq!(value_from_array, value_from_long_slice);

let invalid_slice = &[0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90];
assert_eq!(U128::from_le_slice(invalid_slice), None);
Source§

impl<const N: usize> BUint<N>

Overflowing arithmetic methods which act on self: self.overflowing_.... Each method returns a tuple of type (Self, bool) where the first item of the tuple is the result of the calculation truncated to the number of bits of self, and the second item is a boolean which indicates whether overflow occurred (i.e. if the number of bits of the result of the calculation exceeded the number of bits of self).

Source

pub const fn overflowing_add(self, rhs: Self) -> (Self, bool)

Source

pub const fn overflowing_add_signed(self, rhs: BInt<N>) -> (Self, bool)

Source

pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool)

Source

pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool)

Source

pub const fn overflowing_div(self, rhs: Self) -> (Self, bool)

Source

pub const fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)

Source

pub const fn overflowing_rem(self, rhs: Self) -> (Self, bool)

Source

pub const fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)

Source

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

Source

pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool)

Source

pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool)

Source

pub const fn overflowing_pow(self, pow: u32) -> (Self, bool)

Source§

impl<const N: usize> BUint<N>

Methods which convert a BUint between different types in a given radix (base).

Source

pub const fn parse_bytes(buf: &[u8], radix: u32) -> Option<Self>

Converts a byte slice in a given base to an integer. The input slice must contain ascii/utf8 characters in [0-9a-zA-Z].

This function is equivalent to the from_str_radix function for a string slice equivalent to the byte slice and the same radix.

Returns None if the conversion of the byte slice to string slice fails or if a digit is larger than or equal to the given radix, otherwise the integer is wrapped in Some.

§Panics

This function panics if radix is not in the range from 2 to 36 inclusive.

§Examples
use bnum::types::U512;

let src = "394857hdgfjhsnkg947dgfjkeita";
assert_eq!(U512::from_str_radix(src, 32).ok(), U512::parse_bytes(src.as_bytes(), 32));
Source

pub const fn from_radix_be(buf: &[u8], radix: u32) -> Option<Self>

Converts a slice of big-endian digits in the given radix to an integer. Each u8 of the slice is interpreted as one digit of base radix of the number, so this function will return None if any digit is greater than or equal to radix, otherwise the integer is wrapped in Some.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

§Examples
use bnum::types::U512;

let n = U512::from(34598748526857897975u128);
let digits = n.to_radix_be(12);
assert_eq!(Some(n), U512::from_radix_be(&digits, 12));
Source

pub const fn from_radix_le(buf: &[u8], radix: u32) -> Option<Self>

Converts a slice of little-endian digits in the given radix to an integer. Each u8 of the slice is interpreted as one digit of base radix of the number, so this function will return None if any digit is greater than or equal to radix, otherwise the integer is wrapped in Some.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

§Examples
use bnum::types::U512;

let n = U512::from(109837459878951038945798u128);
let digits = n.to_radix_le(15);
assert_eq!(Some(n), U512::from_radix_le(&digits, 15));
Source

pub const fn from_str_radix( src: &str, radix: u32, ) -> Result<Self, ParseIntError>

Converts a string slice in a given base to an integer.

The string is expected to be an optional + sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on radix:

  • 0-9
  • a-z
  • A-Z
§Panics

This function panics if radix is not in the range from 2 to 36 inclusive.

§Examples
use bnum::types::U512;

assert_eq!(U512::from_str_radix("A", 16), Ok(U512::from(10u128)));
Source

pub const fn parse_str_radix(src: &str, radix: u32) -> Self

This function works the same as from_str_radix except that it returns a BUint instead of a Result<BUint, ParseIntError>.

§Panics

This function panics if radix is not in the range from 2 to 36 inclusive, or if the string cannot be parsed successfully.

§Examples

Basic usage:

// The below example will fail to compile, as the function will panic at compile time:
use bnum::types::U256;

const DOESNT_COMPILE: U256 = U256::parse_str_radix("a13423", 10);
// Gives a compile error of "error[E0080]: evaluation of constant value failed... the evaluated program panicked at 'attempt to parse integer from string containing invalid digit'", 
Source

pub fn to_str_radix(&self, radix: u32) -> String

Returns the integer as a string in the given radix.

§Panics

This function panics if radix is not in the range from 2 to 36 inclusive.

§Examples
use bnum::types::U512;

let src = "934857djkfghhkdfgbf9345hdfkh";
let n = U512::from_str_radix(src, 36).unwrap();
assert_eq!(n.to_str_radix(36), src);
Source

pub fn to_radix_be(&self, radix: u32) -> Vec<u8>

Returns the integer in the given base in big-endian digit order.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

use bnum::types::U512;

let digits = &[3, 55, 60, 100, 5, 0, 5, 88];
let n = U512::from_radix_be(digits, 120).unwrap();
assert_eq!(n.to_radix_be(120), digits);
Source

pub fn to_radix_le(&self, radix: u32) -> Vec<u8>

Returns the integer in the given base in little-endian digit order.

§Panics

This function panics if radix is not in the range from 2 to 256 inclusive.

use bnum::types::U512;

let digits = &[1, 67, 88, 200, 55, 68, 87, 120, 178];
let n = U512::from_radix_le(digits, 250).unwrap();
assert_eq!(n.to_radix_le(250), digits);
Source§

impl<const N: usize> BUint<N>

Saturating arithmetic methods which act on self: self.saturating_.... For each method, if overflow or underflow occurs, the largest or smallest value that can be represented by Self is returned instead.

Source§

impl<const N: usize> BUint<N>

Strict arithmetic methods which act on self: self.strict_.... Each method will always panic if overflow/underflow occurs (i.e. when the checked equivalent would return None), regardless of whether overflow checks are enabled.

Source

pub const fn strict_add(self, rhs: Self) -> Self

Source

pub const fn strict_sub(self, rhs: Self) -> Self

Source

pub const fn strict_mul(self, rhs: Self) -> Self

Source

pub const fn strict_div(self, rhs: Self) -> Self

Source

pub const fn strict_div_euclid(self, rhs: Self) -> Self

Source

pub const fn strict_rem(self, rhs: Self) -> Self

Source

pub const fn strict_rem_euclid(self, rhs: Self) -> Self

Source

pub const fn strict_neg(self) -> Self

Source

pub const fn strict_shl(self, rhs: u32) -> Self

Source

pub const fn strict_shr(self, rhs: u32) -> Self

Source

pub const fn strict_pow(self, exp: u32) -> Self

Source

pub const fn strict_add_signed(self, rhs: BInt<N>) -> Self

Source§

impl<const N: usize> BUint<N>

Unchecked arithmetic methods which act on self: self.unchecked_.... Each method results in undefined behavior if overflow/underflow occurs (i.e. when the checked equivalent would return None).

Source§

impl<const N: usize> BUint<N>

Wrapping arithmetic methods which act on self: self.wrapping_.... Each method returns of the calculation truncated to the number of bits of self (i.e. they each return the first item in the tuple returned by their overflowing equivalent).

Source

pub const fn wrapping_add(self, rhs: Self) -> Self

Source

pub const fn wrapping_add_signed(self, rhs: BInt<N>) -> Self

Source

pub const fn wrapping_sub(self, rhs: Self) -> Self

Source

pub const fn wrapping_mul(self, rhs: Self) -> Self

Source

pub const fn wrapping_div(self, rhs: Self) -> Self

Source

pub const fn wrapping_div_euclid(self, rhs: Self) -> Self

Source

pub const fn wrapping_rem(self, rhs: Self) -> Self

Source

pub const fn wrapping_rem_euclid(self, rhs: Self) -> Self

Source

pub const fn wrapping_neg(self) -> Self

Source

pub const fn wrapping_shl(self, rhs: u32) -> Self

Source

pub const fn wrapping_shr(self, rhs: u32) -> Self

Source

pub const fn wrapping_pow(self, pow: u32) -> Self

Source

pub const fn wrapping_next_power_of_two(self) -> Self

Returns the smallest power of two greater than or equal to self. If the next power of two is greater than Self::MAX, the return value is wrapped to Self::MIN.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.wrapping_next_power_of_two.

§Examples
use bnum::types::U256;

let n = U256::from(31u8);
assert_eq!(n.wrapping_next_power_of_two(), 32u8.into());
assert_eq!(U256::MAX.wrapping_next_power_of_two(), U256::MIN);
Source§

impl<const N: usize> BUint<N>

Source

pub const fn count_ones(self) -> u32

Returns the number of ones in the binary representation of self.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.count_ones.

§Examples
use bnum::types::U1024;

let n = U1024::from(0b010111101010000u16);
assert_eq!(n.count_ones(), 7);
Source

pub const fn count_zeros(self) -> u32

Returns the number of zeros in the binary representation of self.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.count_zeros.

§Examples
use bnum::types::U1024;

assert_eq!((!U1024::ZERO).count_zeros(), 0);
Source

pub const fn leading_zeros(self) -> u32

Returns the number of leading zeros in the binary representation of self.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.leading_zeros.

§Examples
use bnum::types::U1024;

let n = U1024::ZERO;
assert_eq!(n.leading_zeros(), 1024);
Source

pub const fn trailing_zeros(self) -> u32

Returns the number of trailing zeros in the binary representation of self.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.trailing_zeros.

§Examples
use bnum::types::U1024;

let n = (!U1024::ZERO) << 6u32;
assert_eq!(n.trailing_zeros(), 6);
Source

pub const fn leading_ones(self) -> u32

Returns the number of leading ones in the binary representation of self.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.leading_ones.

§Examples
use bnum::types::U1024;

let n = !U1024::ZERO;
assert_eq!(n.leading_ones(), 1024);
Source

pub const fn trailing_ones(self) -> u32

Returns the number of trailing ones in the binary representation of self.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.trailing_ones.

§Examples
use bnum::types::U1024;

let n = U1024::from(0b1000101011011u16);
assert_eq!(n.trailing_ones(), 2);
Source

pub const fn cast_signed(self) -> BInt<N>

Source

pub const fn rotate_left(self, n: u32) -> Self

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isn’t the same operation as the << shifting operator!

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.rotate_left.

Source

pub const fn rotate_right(self, n: u32) -> Self

Shifts the bits to the left by a specified amount, n, wrapping the truncated bits to the end of the resulting integer.

Please note this isn’t the same operation as the >> shifting operator!

self.rotate_right(n) is equivalent to self.rotate_left(Self::BITS - n).

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.rotate_right.

Source

pub const fn swap_bytes(self) -> Self

Reverses the byte order of the integer.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.swap_bytes.

§Examples
use bnum::types::U256;

let n = U256::from(0x12345678901234567890123456789012u128);
assert_eq!(n.swap_bytes().swap_bytes(), n);
Source

pub const fn reverse_bits(self) -> Self

Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.reverse_bits.

§Examples
use bnum::types::U256;

let n = U256::from(0x12345678901234567890123456789012u128);
assert_eq!(n.reverse_bits().reverse_bits(), n);
Source

pub const fn pow(self, exp: u32) -> Self

Raises self to the power of exp, using exponentiation by squaring.

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.pow.

§Examples
use bnum::types::U256;

let n = U256::from(3u8);
assert_eq!(n.pow(5), (243u8).into());
Source

pub const fn div_euclid(self, rhs: Self) -> Self

Source

pub const fn rem_euclid(self, rhs: Self) -> Self

Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == 2^k for some integer k.

§Examples
use bnum::types::U256;

let n = U256::from(1u16 << 14);
assert!(n.is_power_of_two());
let m = U256::from(100u8);
assert!(!m.is_power_of_two());
Source

pub const fn next_power_of_two(self) -> Self

When return value overflows, it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).

See also: https://doc.rust-lang.org/std/primitive.u64.html#method.next_power_of_two.

§Examples
use bnum::types::U256;

let n = U256::from(2u8);
assert_eq!(n.next_power_of_two(), n);
assert_eq!(U256::from(3u8).next_power_of_two(), 4u8.into());
assert_eq!(U256::ZERO.next_power_of_two(), U256::ONE);
Source

pub const fn midpoint(self, rhs: Self) -> Self

Source

pub const fn ilog2(self) -> u32

Source

pub const fn ilog10(self) -> u32

Source

pub const fn ilog(self, base: Self) -> u32

Source

pub const fn abs_diff(self, other: Self) -> Self

Source

pub const fn next_multiple_of(self, rhs: Self) -> Self

Source

pub const fn div_floor(self, rhs: Self) -> Self

Source

pub const fn div_ceil(self, rhs: Self) -> Self

Source§

impl<const N: usize> BUint<N>

Source

pub const fn bits(&self) -> u32

Returns the smallest number of bits necessary to represent self.

This is equal to the size of the type in bits minus the leading zeros of self.

§Examples
use bnum::types::U256;

assert_eq!(U256::from(0b1111001010100u16).bits(), 13);
assert_eq!(U256::ZERO.bits(), 0);
Source

pub const fn bit(&self, index: u32) -> bool

Returns a boolean representing the bit in the given position (true if the bit is set). The least significant bit is at index 0, the most significant bit is at index Self::BITS - 1.

§Examples
use bnum::types::U256;

let n = U256::from(0b001010100101010101u32);
assert!(n.bit(0));
assert!(!n.bit(1));
assert!(!n.bit(U256::BITS - 1));
Source

pub fn set_bit(&mut self, index: u32, value: bool)

Sets/unsets the bit in the given position (1 if value is true). The least significant bit is at index 0, the most significant bit is at index Self::BITS - 1.

§Examples
use bnum::types::U256;

let mut n = U256::from(0b001010100101010101u32);
assert!(n.bit(2));
n.set_bit(2, false);
assert!(!n.bit(2));
assert_eq!(n, U256::from(0b001010100101010001u32));
Source

pub const fn power_of_two(power: u32) -> Self

Returns an integer whose value is 2^power. This is faster than using a shift left on Self::ONE.

§Panics

This function will panic if power is greater than or equal to Self::BITS.

§Examples
use bnum::types::U256;

let power = 11;
assert_eq!(U256::power_of_two(11), (1u128 << 11).into());
Source

pub const fn digits(&self) -> &[u64; N]

Returns the digits stored in self as an array. Digits are little endian (least significant digit first).

Source

pub fn digits_mut(&mut self) -> &mut [u64; N]

Returns the digits stored in self as a mutable array. Digits are little endian (least significant digit first).

Source

pub const fn from_digits(digits: [u64; N]) -> Self

Creates a new unsigned integer from the given array of digits. Digits are stored as little endian (least significant digit first).

Source

pub const fn from_digit(digit: u64) -> Self

Creates a new unsigned integer from the given digit. The given digit is stored as the least significant digit.

Source

pub const fn is_zero(&self) -> bool

Returns whether self is zero.

§Examples
use bnum::types::U256;

assert!(U256::ZERO.is_zero());
assert!(!U256::ONE.is_zero());
Source

pub const fn is_one(&self) -> bool

Returns whether self is one.

§Examples
use bnum::types::U256;

assert!(U256::ONE.is_one());
assert!(!U256::MAX.is_one());

Trait Implementations§

Source§

impl<const N: usize> Add<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &BUint<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &BUint<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: BUint<N>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize> Add<u64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u64) -> Self

Performs the + operation. Read more
Source§

impl<const N: usize> Add for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<const N: usize> AddAssign<&BUint<N>> for BUint<N>

Source§

fn add_assign(&mut self, rhs: &BUint<N>)

Performs the += operation. Read more
Source§

impl<const N: usize> AddAssign for BUint<N>

Source§

fn add_assign(&mut self, rhs: BUint<N>)

Performs the += operation. Read more
Source§

impl<const N: usize, const M: usize> BTryFrom<BInt<N>> for BUint<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BInt<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BIntD16<N>> for BUint<M>

Source§

impl<const N: usize, const M: usize> BTryFrom<BIntD32<N>> for BUint<M>

Source§

impl<const N: usize, const M: usize> BTryFrom<BIntD8<N>> for BUint<M>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BInt<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BIntD16<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BIntD32<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BIntD8<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUint<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUintD16<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUintD32<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUint<N>> for BUintD8<M>

Source§

type Error = TryFromIntError

Source§

fn try_from(from: BUint<N>) -> Result<Self, Self::Error>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUintD16<N>> for BUint<M>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUintD32<N>> for BUint<M>

Source§

impl<const N: usize, const M: usize> BTryFrom<BUintD8<N>> for BUint<M>

Source§

impl<const N: usize> Binary for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> BitAnd<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &BUint<N>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: usize> BitAnd<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &BUint<N>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: usize> BitAnd<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: BUint<N>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: usize> BitAnd for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
Source§

impl<const N: usize> BitAndAssign<&BUint<N>> for BUint<N>

Source§

fn bitand_assign(&mut self, rhs: &BUint<N>)

Performs the &= operation. Read more
Source§

impl<const N: usize> BitAndAssign for BUint<N>

Source§

fn bitand_assign(&mut self, rhs: BUint<N>)

Performs the &= operation. Read more
Source§

impl<const N: usize> BitOr<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &BUint<N>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: usize> BitOr<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &BUint<N>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: usize> BitOr<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: BUint<N>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: usize> BitOr for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl<const N: usize> BitOrAssign<&BUint<N>> for BUint<N>

Source§

fn bitor_assign(&mut self, rhs: &BUint<N>)

Performs the |= operation. Read more
Source§

impl<const N: usize> BitOrAssign for BUint<N>

Source§

fn bitor_assign(&mut self, rhs: BUint<N>)

Performs the |= operation. Read more
Source§

impl<const N: usize> BitXor<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &BUint<N>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: usize> BitXor<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &BUint<N>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: usize> BitXor<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: BUint<N>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: usize> BitXor for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self

Performs the ^ operation. Read more
Source§

impl<const N: usize> BitXorAssign<&BUint<N>> for BUint<N>

Source§

fn bitxor_assign(&mut self, rhs: &BUint<N>)

Performs the ^= operation. Read more
Source§

impl<const N: usize> BitXorAssign for BUint<N>

Source§

fn bitxor_assign(&mut self, rhs: BUint<N>)

Performs the ^= operation. Read more
Source§

impl<const N: usize, const M: usize> CastFrom<BInt<M>> for BUint<N>

Source§

fn cast_from(from: BInt<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BIntD16<M>> for BUint<N>

Source§

fn cast_from(from: BIntD16<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BIntD32<M>> for BUint<N>

Source§

fn cast_from(from: BIntD32<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BIntD8<M>> for BUint<N>

Source§

fn cast_from(from: BIntD8<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BInt<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BIntD16<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BIntD32<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BIntD8<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BUint<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BUintD16<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BUintD32<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUint<M>> for BUintD8<N>

Source§

fn cast_from(from: BUint<M>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for f32

Source§

fn cast_from(value: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for f64

Source§

fn cast_from(value: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for i128

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for i16

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for i32

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for i64

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for i8

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for isize

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for u128

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for u16

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for u32

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for u64

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for u8

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize> CastFrom<BUint<N>> for usize

Source§

fn cast_from(from: BUint<N>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUintD16<M>> for BUint<N>

Source§

fn cast_from(from: BUintD16<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUintD32<M>> for BUint<N>

Source§

fn cast_from(from: BUintD32<M>) -> Self

Source§

impl<const N: usize, const M: usize> CastFrom<BUintD8<M>> for BUint<N>

Source§

fn cast_from(from: BUintD8<M>) -> Self

Source§

impl<const N: usize> CastFrom<bool> for BUint<N>

Source§

fn cast_from(from: bool) -> Self

Source§

impl<const N: usize> CastFrom<char> for BUint<N>

Source§

fn cast_from(from: char) -> Self

Source§

impl<const N: usize> CastFrom<f32> for BUint<N>

Source§

fn cast_from(value: f32) -> Self

Source§

impl<const N: usize> CastFrom<f64> for BUint<N>

Source§

fn cast_from(value: f64) -> Self

Source§

impl<const N: usize> CastFrom<i128> for BUint<N>

Source§

fn cast_from(from: i128) -> Self

Source§

impl<const N: usize> CastFrom<i16> for BUint<N>

Source§

fn cast_from(from: i16) -> Self

Source§

impl<const N: usize> CastFrom<i32> for BUint<N>

Source§

fn cast_from(from: i32) -> Self

Source§

impl<const N: usize> CastFrom<i64> for BUint<N>

Source§

fn cast_from(from: i64) -> Self

Source§

impl<const N: usize> CastFrom<i8> for BUint<N>

Source§

fn cast_from(from: i8) -> Self

Source§

impl<const N: usize> CastFrom<isize> for BUint<N>

Source§

fn cast_from(from: isize) -> Self

Source§

impl<const N: usize> CastFrom<u128> for BUint<N>

Source§

fn cast_from(from: u128) -> Self

Source§

impl<const N: usize> CastFrom<u16> for BUint<N>

Source§

fn cast_from(from: u16) -> Self

Source§

impl<const N: usize> CastFrom<u32> for BUint<N>

Source§

fn cast_from(from: u32) -> Self

Source§

impl<const N: usize> CastFrom<u64> for BUint<N>

Source§

fn cast_from(from: u64) -> Self

Source§

impl<const N: usize> CastFrom<u8> for BUint<N>

Source§

fn cast_from(from: u8) -> Self

Source§

impl<const N: usize> CastFrom<usize> for BUint<N>

Source§

fn cast_from(from: usize) -> Self

Source§

impl<const N: usize> Clone for BUint<N>

Source§

fn clone(&self) -> BUint<N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Default for BUint<N>

Source§

fn default() -> Self

Returns the default value of Self::ZERO.

Source§

impl<'de, const N: usize> Deserialize<'de> for BUint<N>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<const N: usize> Display for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Div<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &BUint<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &BUint<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: BUint<N>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize> Div<u64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u64) -> Self

Performs the / operation. Read more
Source§

impl<const N: usize> Div for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
Source§

impl<const N: usize> DivAssign<&BUint<N>> for BUint<N>

Source§

fn div_assign(&mut self, rhs: &BUint<N>)

Performs the /= operation. Read more
Source§

impl<const N: usize> DivAssign for BUint<N>

Source§

fn div_assign(&mut self, rhs: BUint<N>)

Performs the /= operation. Read more
Source§

impl<const N: usize> From<[u64; N]> for BUint<N>

Source§

fn from(digits: [u64; N]) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<BUint<N>> for [u64; N]

Source§

fn from(uint: BUint<N>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<bool> for BUint<N>

Source§

fn from(small: bool) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<char> for BUint<N>

Source§

fn from(c: char) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u128> for BUint<N>

Source§

fn from(int: u128) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u16> for BUint<N>

Source§

fn from(int: u16) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u32> for BUint<N>

Source§

fn from(int: u32) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u64> for BUint<N>

Source§

fn from(int: u64) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<u8> for BUint<N>

Source§

fn from(int: u8) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<usize> for BUint<N>

Source§

fn from(int: usize) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> FromStr for BUint<N>

Source§

type Err = ParseIntError

The associated error which can be returned from parsing.
Source§

fn from_str(src: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<const N: usize> Hash for BUint<N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: usize> LowerExp for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> LowerHex for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Mul<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &BUint<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &BUint<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: BUint<N>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize> Mul for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl<const N: usize> MulAssign<&BUint<N>> for BUint<N>

Source§

fn mul_assign(&mut self, rhs: &BUint<N>)

Performs the *= operation. Read more
Source§

impl<const N: usize> MulAssign for BUint<N>

Source§

fn mul_assign(&mut self, rhs: BUint<N>)

Performs the *= operation. Read more
Source§

impl<const N: usize> Not for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the ! operator.
Source§

fn not(self) -> BUint<N>

Performs the unary ! operation. Read more
Source§

impl<const N: usize> Not for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<const N: usize> Octal for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Ord for BUint<N>

Source§

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

This method returns an Ordering between self and other. Read more
Source§

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

Compares and returns the maximum of two values. Read more
Source§

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

Compares and returns the minimum of two values. Read more
Source§

fn clamp(self, min: Self, max: Self) -> Self

Restrict a value to a certain interval. Read more
Source§

impl<const N: usize> PartialEq for BUint<N>

Source§

fn eq(&self, other: &BUint<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialOrd for BUint<N>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a, const N: usize> Product<&'a BUint<N>> for BUint<N>

Source§

fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<const N: usize> Product for BUint<N>

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<const N: usize> Rem<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &BUint<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &BUint<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: BUint<N>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize> Rem<u64> for BUint<N>

Source§

type Output = u64

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u64) -> u64

Performs the % operation. Read more
Source§

impl<const N: usize> Rem for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self

Performs the % operation. Read more
Source§

impl<const N: usize> RemAssign<&BUint<N>> for BUint<N>

Source§

fn rem_assign(&mut self, rhs: &BUint<N>)

Performs the %= operation. Read more
Source§

impl<const N: usize> RemAssign for BUint<N>

Source§

fn rem_assign(&mut self, rhs: BUint<N>)

Performs the %= operation. Read more
Source§

impl<const N: usize> Serialize for BUint<N>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const N: usize, const M: usize> Shl<&BInt<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &BInt<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<&BInt<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &BInt<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<&BUint<M>> for &BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &BUint<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<&BUint<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &BUint<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<&BUint<M>> for BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &BUint<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<&BUint<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &BUint<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&i8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&isize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&isize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&u8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&usize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<&usize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<BInt<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BInt<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<BInt<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BInt<M>) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<BUint<M>> for &BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BUint<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<BUint<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BUint<M>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<BUint<M>> for BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BUint<M>) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> Shl<BUint<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: BUint<M>) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<i8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<isize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<isize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

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

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<u8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<usize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<usize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self

Performs the << operation. Read more
Source§

impl<const N: usize, const M: usize> ShlAssign<&BInt<M>> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &BInt<M>)

Performs the <<= operation. Read more
Source§

impl<const N: usize, const M: usize> ShlAssign<&BUint<M>> for BInt<N>

Source§

fn shl_assign(&mut self, rhs: &BUint<M>)

Performs the <<= operation. Read more
Source§

impl<const N: usize, const M: usize> ShlAssign<&BUint<M>> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &BUint<M>)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&i128> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &i128)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&i16> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &i16)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&i32> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &i32)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&i64> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &i64)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&i8> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &i8)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&isize> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &isize)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&u128> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &u128)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&u16> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &u16)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&u32> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &u32)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&u64> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &u64)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&u8> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &u8)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<&usize> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: &usize)

Performs the <<= operation. Read more
Source§

impl<const N: usize, const M: usize> ShlAssign<BInt<M>> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: BInt<M>)

Performs the <<= operation. Read more
Source§

impl<const N: usize, const M: usize> ShlAssign<BUint<M>> for BInt<N>

Source§

fn shl_assign(&mut self, rhs: BUint<M>)

Performs the <<= operation. Read more
Source§

impl<const N: usize, const M: usize> ShlAssign<BUint<M>> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: BUint<M>)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<i128> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<i16> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: i16)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<i32> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<i64> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<i8> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: i8)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<isize> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: isize)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<u128> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: u128)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<u16> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: u16)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<u32> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<u64> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<u8> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: u8)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<usize> for BUint<N>

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<&BInt<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &BInt<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<&BInt<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &BInt<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<&BUint<M>> for &BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &BUint<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<&BUint<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &BUint<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<&BUint<M>> for BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &BUint<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<&BUint<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &BUint<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&i8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&isize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&isize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&u8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&usize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<&usize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<BInt<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BInt<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<BInt<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BInt<M>) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<BUint<M>> for &BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BUint<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<BUint<M>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BUint<M>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<BUint<M>> for BInt<N>

Source§

type Output = BInt<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BUint<M>) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> Shr<BUint<M>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: BUint<M>) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<i8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<isize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<isize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u128> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u128> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u16> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u16> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u32> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u32> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

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

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u64> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u64> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u8> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<u8> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<usize> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<usize> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self

Performs the >> operation. Read more
Source§

impl<const N: usize, const M: usize> ShrAssign<&BInt<M>> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &BInt<M>)

Performs the >>= operation. Read more
Source§

impl<const N: usize, const M: usize> ShrAssign<&BUint<M>> for BInt<N>

Source§

fn shr_assign(&mut self, rhs: &BUint<M>)

Performs the >>= operation. Read more
Source§

impl<const N: usize, const M: usize> ShrAssign<&BUint<M>> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &BUint<M>)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&i128> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &i128)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&i16> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &i16)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&i32> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &i32)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&i64> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &i64)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&i8> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &i8)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&isize> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &isize)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&u128> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &u128)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&u16> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &u16)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&u32> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &u32)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&u64> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &u64)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&u8> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &u8)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<&usize> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: &usize)

Performs the >>= operation. Read more
Source§

impl<const N: usize, const M: usize> ShrAssign<BInt<M>> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: BInt<M>)

Performs the >>= operation. Read more
Source§

impl<const N: usize, const M: usize> ShrAssign<BUint<M>> for BInt<N>

Source§

fn shr_assign(&mut self, rhs: BUint<M>)

Performs the >>= operation. Read more
Source§

impl<const N: usize, const M: usize> ShrAssign<BUint<M>> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: BUint<M>)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<i128> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<i16> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: i16)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<i32> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<i64> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<i8> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: i8)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<isize> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: isize)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<u128> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: u128)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<u16> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: u16)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<u32> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<u64> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<u8> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<usize> for BUint<N>

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl<const N: usize> Sub<&BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &BUint<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<&BUint<N>> for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &BUint<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub<BUint<N>> for &BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: BUint<N>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize> Sub for BUint<N>

Source§

type Output = BUint<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<const N: usize> SubAssign<&BUint<N>> for BUint<N>

Source§

fn sub_assign(&mut self, rhs: &BUint<N>)

Performs the -= operation. Read more
Source§

impl<const N: usize> SubAssign for BUint<N>

Source§

fn sub_assign(&mut self, rhs: BUint<N>)

Performs the -= operation. Read more
Source§

impl<'a, const N: usize> Sum<&'a BUint<N>> for BUint<N>

Source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const N: usize> Sum for BUint<N>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<const N: usize> TryFrom<BUint<N>> for i128

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<i128, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for i16

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<i16, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for i32

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<i32, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for i64

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<i64, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for i8

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<i8, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for isize

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<isize, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for u128

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<u128, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for u16

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<u16, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for u32

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<u32, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for u64

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<u64, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for u8

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<u8, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<BUint<N>> for usize

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: BUint<N>) -> Result<usize, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i128> for BUint<N>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i16> for BUint<N>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i32> for BUint<N>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i64> for BUint<N>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<i8> for BUint<N>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(int: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<isize> for BUint<N>

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(int: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const N: usize> UpperExp for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> UpperHex for BUint<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Copy for BUint<N>

Source§

impl<const N: usize> Eq for BUint<N>

Source§

impl<const N: usize> StructuralPartialEq for BUint<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for BUint<N>

§

impl<const N: usize> RefUnwindSafe for BUint<N>

§

impl<const N: usize> Send for BUint<N>

§

impl<const N: usize> Sync for BUint<N>

§

impl<const N: usize> Unpin for BUint<N>

§

impl<const N: usize> UnsafeUnpin for BUint<N>

§

impl<const N: usize> UnwindSafe for BUint<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,