Struct ethnum::U256

source ·
#[repr(transparent)]
pub struct U256(pub [u128; 2]);
Expand description

A 256-bit unsigned integer type.

Tuple Fields§

§0: [u128; 2]

Implementations§

source§

impl U256

source

pub const MIN: Self = _

The smallest value that can be represented by this integer type.

Examples

Basic usage:

assert_eq!(U256::MIN, U256::new(0));
source

pub const MAX: Self = _

The largest value that can be represented by this integer type.

Examples

Basic usage:

assert_eq!(
    U256::MAX.to_string(),
    "115792089237316195423570985008687907853269984665640564039457584007913129639935",
);
source

pub const BITS: u32 = 256u32

The size of this integer type in bits.

Examples
assert_eq!(U256::BITS, 256);
source

pub 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.

Examples

Basic usage:

assert_eq!(U256::from_str_radix("A", 16), Ok(U256::new(10)));
source

pub const fn count_ones(self) -> u32

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

Examples

Basic usage:

let n = U256::new(0b01001100);
assert_eq!(n.count_ones(), 3);
source

pub const fn count_zeros(self) -> u32

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

Examples

Basic usage:

assert_eq!(U256::MIN.count_zeros(), 256);
assert_eq!(U256::MAX.count_zeros(), 0);
source

pub fn leading_zeros(self) -> u32

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

Examples

Basic usage:

let n = U256::MAX >> 2u32;
assert_eq!(n.leading_zeros(), 2);
source

pub fn trailing_zeros(self) -> u32

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

Examples

Basic usage:

let n = U256::new(0b0101000);
assert_eq!(n.trailing_zeros(), 3);
source

pub fn leading_ones(self) -> u32

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

Examples

Basic usage:

let n = !(U256::MAX >> 2u32);
assert_eq!(n.leading_ones(), 2);
source

pub fn trailing_ones(self) -> u32

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

Examples

Basic usage:

let n = U256::new(0b1010111);
assert_eq!(n.trailing_ones(), 3);
source

pub 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!

Examples

Basic usage:

let n = U256::from_words(
    0x13f40000000000000000000000000000,
    0x00000000000000000000000000004f76,
);
let m = U256::new(0x4f7613f4);
assert_eq!(n.rotate_left(16), m);
source

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

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

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

Examples

Basic usage:

let n = U256::new(0x4f7613f4);
let m = U256::from_words(
    0x13f40000000000000000000000000000,
    0x00000000000000000000000000004f76,
);

assert_eq!(n.rotate_right(16), m);
source

pub const fn swap_bytes(self) -> Self

Reverses the byte order of the integer.

Examples

Basic usage:

let n = U256::from_words(
    0x00010203_04050607_08090a0b_0c0d0e0f,
    0x10111213_14151617_18191a1b_1c1d1e1f,
);
assert_eq!(
    n.swap_bytes(),
    U256::from_words(
        0x1f1e1d1c_1b1a1918_17161514_13121110,
        0x0f0e0d0c_0b0a0908_07060504_03020100,
    ),
);
source

pub const fn reverse_bits(self) -> Self

Reverses the bit pattern of the integer.

Examples

Basic usage:

let n = U256::from_words(
    0x00010203_04050607_08090a0b_0c0d0e0f,
    0x10111213_14151617_18191a1b_1c1d1e1f,
);
assert_eq!(
    n.reverse_bits(),
    U256::from_words(
        0xf878b838_d8589818_e868a828_c8488808,
        0xf070b030_d0509010_e060a020_c0408000,
    ),
);
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.

Examples

Basic usage:

let n = U256::new(0x1A);
if cfg!(target_endian = "big") {
    assert_eq!(U256::from_be(n), n);
} else {
    assert_eq!(U256::from_be(n), n.swap_bytes());
}
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.

Examples

Basic usage:

let n = U256::new(0x1A);
if cfg!(target_endian = "little") {
    assert_eq!(U256::from_le(n), n)
} else {
    assert_eq!(U256::from_le(n), n.swap_bytes())
}
source

pub const fn to_be(self) -> Self

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

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

Examples

Basic usage:

let n = U256::new(0x1A);
if cfg!(target_endian = "big") {
    assert_eq!(n.to_be(), n)
} else {
    assert_eq!(n.to_be(), n.swap_bytes())
}
source

pub const fn to_le(self) -> Self

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

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

Examples

Basic usage:

let n = U256::new(0x1A);
if cfg!(target_endian = "little") {
    assert_eq!(n.to_le(), n)
} else {
    assert_eq!(n.to_le(), n.swap_bytes())
}
source

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

Checked integer addition. Computes self + rhs, returning None if overflow occurred.

Examples

Basic usage:

assert_eq!((U256::MAX - 2).checked_add(U256::new(1)), Some(U256::MAX - 1));
assert_eq!((U256::MAX - 2).checked_add(U256::new(3)), None);
source

pub fn checked_add_signed(self, rhs: I256) -> Option<Self>

Checked addition with a signed integer. Computes self + rhs, returning None if overflow occurred.

Examples

Basic usage:

assert_eq!(U256::new(1).checked_add_signed(I256::new(2)), Some(U256::new(3)));
assert_eq!(U256::new(1).checked_add_signed(I256::new(-2)), None);
assert_eq!((U256::MAX - 2).checked_add_signed(I256::new(3)), None);
source

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

Checked integer subtraction. Computes self - rhs, returning None if overflow occurred.

Examples

Basic usage:

assert_eq!(U256::new(1).checked_sub(U256::new(1)), Some(U256::ZERO));
assert_eq!(U256::new(0).checked_sub(U256::new(1)), None);
source

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

Checked integer multiplication. Computes self * rhs, returning None if overflow occurred.

Examples

Basic usage:

assert_eq!(U256::new(5).checked_mul(U256::new(1)), Some(U256::new(5)));
assert_eq!(U256::MAX.checked_mul(U256::new(2)), None);
source

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

Checked integer division. Computes self / rhs, returning None if rhs == 0.

Examples

Basic usage:

assert_eq!(U256::new(128).checked_div(U256::new(2)), Some(U256::new(64)));
assert_eq!(U256::new(1).checked_div(U256::new(0)), None);
source

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

Checked Euclidean division. Computes self.div_euclid(rhs), returning None if rhs == 0.

Examples

Basic usage:

assert_eq!(U256::new(128).checked_div_euclid(U256::new(2)), Some(U256::new(64)));
assert_eq!(U256::new(1).checked_div_euclid(U256::new(0)), None);
source

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

Checked integer remainder. Computes self % rhs, returning None if rhs == 0.

Examples

Basic usage:

assert_eq!(U256::new(5).checked_rem(U256::new(2)), Some(U256::new(1)));
assert_eq!(U256::new(5).checked_rem(U256::new(0)), None);
source

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

Checked Euclidean modulo. Computes self.rem_euclid(rhs), returning None if rhs == 0.

Examples

Basic usage:

assert_eq!(U256::new(5).checked_rem_euclid(U256::new(2)), Some(U256::new(1)));
assert_eq!(U256::new(5).checked_rem_euclid(U256::new(0)), None);
source

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

Checked negation. Computes -self, returning None unless self == 0.

Note that negating any positive integer will overflow.

Examples

Basic usage:

assert_eq!(U256::ZERO.checked_neg(), Some(U256::ZERO));
assert_eq!(U256::new(1).checked_neg(), None);
source

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

Checked shift left. Computes self << rhs, returning None if rhs is larger than or equal to the number of bits in self.

Examples

Basic usage:

assert_eq!(U256::new(0x1).checked_shl(4), Some(U256::new(0x10)));
assert_eq!(U256::new(0x10).checked_shl(257), None);
source

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

Checked shift right. Computes self >> rhs, returning None if rhs is larger than or equal to the number of bits in self.

Examples

Basic usage:

assert_eq!(U256::new(0x10).checked_shr(4), Some(U256::new(0x1)));
assert_eq!(U256::new(0x10).checked_shr(257), None);
source

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

Checked exponentiation. Computes self.pow(exp), returning None if overflow occurred.

Examples

Basic usage:

assert_eq!(U256::new(2).checked_pow(5), Some(U256::new(32)));
assert_eq!(U256::MAX.checked_pow(2), None);
source

pub fn saturating_add(self, rhs: Self) -> Self

Saturating integer addition. Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Examples

Basic usage:

assert_eq!(U256::new(100).saturating_add(U256::new(1)), U256::new(101));
assert_eq!(U256::MAX.saturating_add(U256::new(127)), U256::MAX);
source

pub fn saturating_add_signed(self, rhs: I256) -> Self

Saturating addition with a signed integer. Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Examples

Basic usage:

assert_eq!(U256::new(1).saturating_add_signed(I256::new(2)), U256::new(3));
assert_eq!(U256::new(1).saturating_add_signed(I256::new(-2)), U256::new(0));
assert_eq!((U256::MAX - 2).saturating_add_signed(I256::new(4)), U256::MAX);
source

pub fn saturating_sub(self, rhs: Self) -> Self

Saturating integer subtraction. Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Examples

Basic usage:

assert_eq!(U256::new(100).saturating_sub(U256::new(27)), U256::new(73));
assert_eq!(U256::new(13).saturating_sub(U256::new(127)), U256::new(0));
source

pub fn saturating_mul(self, rhs: Self) -> Self

Saturating integer multiplication. Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Examples

Basic usage:

assert_eq!(U256::new(2).saturating_mul(U256::new(10)), U256::new(20));
assert_eq!((U256::MAX).saturating_mul(U256::new(10)), U256::MAX);
source

pub fn saturating_div(self, rhs: Self) -> Self

Saturating integer division. Computes self / rhs, saturating at the numeric bounds instead of overflowing.

Examples

Basic usage:

assert_eq!(U256::new(5).saturating_div(U256::new(2)), U256::new(2));
let _ = U256::new(1).saturating_div(U256::ZERO);
source

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

Saturating integer exponentiation. Computes self.pow(exp), saturating at the numeric bounds instead of overflowing.

Examples

Basic usage:

assert_eq!(U256::new(4).saturating_pow(3), U256::new(64));
assert_eq!(U256::MAX.saturating_pow(2), U256::MAX);
source

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

Wrapping (modular) addition. Computes self + rhs, wrapping around at the boundary of the type.

Examples

Basic usage:

assert_eq!(U256::new(200).wrapping_add(U256::new(55)), U256::new(255));
assert_eq!(U256::new(200).wrapping_add(U256::MAX), U256::new(199));
source

pub fn wrapping_add_signed(self, rhs: I256) -> Self

Wrapping (modular) addition with a signed integer. Computes self + rhs, wrapping around at the boundary of the type.

Examples

Basic usage:

assert_eq!(U256::new(1).wrapping_add_signed(I256::new(2)), U256::new(3));
assert_eq!(U256::new(1).wrapping_add_signed(I256::new(-2)), U256::MAX);
assert_eq!((U256::MAX - 2).wrapping_add_signed(I256::new(4)), U256::new(1));
source

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

Wrapping (modular) subtraction. Computes self - rhs, wrapping around at the boundary of the type.

Examples

Basic usage:

assert_eq!(U256::new(100).wrapping_sub(U256::new(100)), U256::new(0));
assert_eq!(U256::new(100).wrapping_sub(U256::MAX), U256::new(101));
source

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

Wrapping (modular) multiplication. Computes self * rhs, wrapping around at the boundary of the type.

Examples

Basic usage:

Please note that this example is shared between integer types. Which explains why u8 is used here.

assert_eq!(U256::new(10).wrapping_mul(U256::new(12)), U256::new(120));
assert_eq!(U256::MAX.wrapping_mul(U256::new(2)), U256::MAX - 1);
source

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

Wrapping (modular) division. Computes self / rhs. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.

Examples

Basic usage:

assert_eq!(U256::new(100).wrapping_div(U256::new(10)), U256::new(10));
source

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

Wrapping Euclidean division. Computes self.div_euclid(rhs). Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.wrapping_div(rhs).

Examples

Basic usage:

assert_eq!(U256::new(100).wrapping_div_euclid(U256::new(10)), U256::new(10));
source

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

Wrapping (modular) remainder. Computes self % rhs. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.

Examples

Basic usage:

assert_eq!(U256::new(100).wrapping_rem(U256::new(10)), U256::new(0));
source

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

Wrapping Euclidean modulo. Computes self.rem_euclid(rhs). Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.wrapping_rem(rhs).

Examples

Basic usage:

assert_eq!(U256::new(100).wrapping_rem_euclid(U256::new(10)), U256::new(0));
source

pub fn wrapping_neg(self) -> Self

Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type.

Since unsigned types do not have negative equivalents all applications of this function will wrap (except for -0). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to MAX + 1 - (val - MAX - 1) where MAX is the corresponding signed type’s maximum.

Examples

Basic usage:

Please note that this example is shared between integer types. Which explains why i8 is used here.

assert_eq!(U256::new(100).wrapping_neg(), (-100i128).as_u256());
assert_eq!(
    U256::from_words(i128::MIN as _, 0).wrapping_neg(),
    U256::from_words(i128::MIN as _, 0),
);
source

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

Panic-free bitwise shift-left; yields self << mask(rhs), where mask removes any high-order bits of rhs that would cause the shift to exceed the bitwidth of the type.

Note that this is not the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a rotate_left function, which maybe what you want instead.

Examples

Basic usage:

assert_eq!(U256::new(1).wrapping_shl(7), U256::new(128));
assert_eq!(U256::new(1).wrapping_shl(128), U256::from_words(1, 0));
assert_eq!(U256::new(1).wrapping_shl(256), U256::new(1));
source

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

Panic-free bitwise shift-right; yields self >> mask(rhs), where mask removes any high-order bits of rhs that would cause the shift to exceed the bitwidth of the type.

Note that this is not the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a rotate_right function, which may be what you want instead.

Examples

Basic usage:

assert_eq!(U256::new(128).wrapping_shr(7), U256::new(1));
assert_eq!(U256::from_words(128, 0).wrapping_shr(128), U256::new(128));
assert_eq!(U256::new(128).wrapping_shr(256), U256::new(128));
source

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

Wrapping (modular) exponentiation. Computes self.pow(exp), wrapping around at the boundary of the type.

Examples

Basic usage:

assert_eq!(U256::new(3).wrapping_pow(5), U256::new(243));
assert_eq!(
    U256::new(1337).wrapping_pow(42),
    U256::from_words(
        45367329835866155830012179193722278514,
        159264946433345088039815329994094210673,
    ),
);
source

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

Calculates self + rhs

Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

Examples

Basic usage

assert_eq!(U256::new(5).overflowing_add(U256::new(2)), (U256::new(7), false));
assert_eq!(U256::MAX.overflowing_add(U256::new(1)), (U256::new(0), true));
source

pub fn overflowing_add_signed(self, rhs: I256) -> (Self, bool)

Calculates self + rhs with a signed rhs

Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

Examples

Basic usage:

assert_eq!(U256::new(1).overflowing_add_signed(I256::new(2)), (U256::new(3), false));
assert_eq!(U256::new(1).overflowing_add_signed(I256::new(-2)), (U256::MAX, true));
assert_eq!((U256::MAX - 2).overflowing_add_signed(I256::new(4)), (U256::new(1), true));
source

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

Calculates self - rhs

Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

Examples

Basic usage

assert_eq!(U256::new(5).overflowing_sub(U256::new(2)), (U256::new(3), false));
assert_eq!(U256::new(0).overflowing_sub(U256::new(1)), (U256::MAX, true));
source

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

Computes the absolute difference between self and other.

Examples

Basic usage:

assert_eq!(U256::new(100).abs_diff(U256::new(80)), 20);
assert_eq!(U256::new(100).abs_diff(U256::new(110)), 10);
source

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

Calculates the multiplication of self and rhs.

Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.

Examples

Basic usage:

Please note that this example is shared between integer types. Which explains why u32 is used here.

assert_eq!(U256::new(5).overflowing_mul(U256::new(2)), (U256::new(10), false));
assert_eq!(
    U256::MAX.overflowing_mul(U256::new(2)),
    (U256::MAX - 1, true),
);
source

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

Calculates the divisor when self is divided by rhs.

Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false.

Panics

This function will panic if rhs is 0.

Examples

Basic usage

assert_eq!(U256::new(5).overflowing_div(U256::new(2)), (U256::new(2), false));
source

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

Calculates the quotient of Euclidean division self.div_euclid(rhs).

Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.overflowing_div(rhs).

Panics

This function will panic if rhs is 0.

Examples

Basic usage

assert_eq!(U256::new(5).overflowing_div_euclid(U256::new(2)), (U256::new(2), false));
source

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

Calculates the remainder when self is divided by rhs.

Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false.

Panics

This function will panic if rhs is 0.

Examples

Basic usage

assert_eq!(U256::new(5).overflowing_rem(U256::new(2)), (U256::new(1), false));
source

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

Calculates the remainder self.rem_euclid(rhs) as if by Euclidean division.

Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to self.overflowing_rem(rhs).

Panics

This function will panic if rhs is 0.

Examples

Basic usage

assert_eq!(U256::new(5).overflowing_rem_euclid(U256::new(2)), (U256::new(1), false));
source

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

Negates self in an overflowing fashion.

Returns !self + 1 using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.

Examples

Basic usage

assert_eq!(U256::new(0).overflowing_neg(), (U256::new(0), false));
assert_eq!(U256::new(2).overflowing_neg(), ((-2i32).as_u256(), true));
source

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

Shifts self left by rhs bits.

Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.

Examples

Basic usage

assert_eq!(U256::new(0x1).overflowing_shl(4), (U256::new(0x10), false));
assert_eq!(U256::new(0x1).overflowing_shl(260), (U256::new(0x10), true));
source

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

Shifts self right by rhs bits.

Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.

Examples

Basic usage

assert_eq!(U256::new(0x10).overflowing_shr(4), (U256::new(0x1), false));
assert_eq!(U256::new(0x10).overflowing_shr(260), (U256::new(0x1), true));
source

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

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

Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.

Examples

Basic usage:

assert_eq!(U256::new(3).overflowing_pow(5), (U256::new(243), false));
assert_eq!(
    U256::new(1337).overflowing_pow(42),
    (
        U256::from_words(
            45367329835866155830012179193722278514,
            159264946433345088039815329994094210673,
        ),
        true,
    )
);
source

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

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

Examples

Basic usage:

assert_eq!(U256::new(2).pow(5), U256::new(32));
source

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

Performs Euclidean division.

Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self / rhs.

Panics

This function will panic if rhs is 0.

Examples

Basic usage:

assert_eq!(U256::new(7).div_euclid(U256::new(4)), U256::new(1));
source

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

Calculates the least remainder of self (mod rhs).

Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self % rhs.

Panics

This function will panic if rhs is 0.

Examples

Basic usage:

assert_eq!(U256::new(7).rem_euclid(U256::new(4)), U256::new(3));
source

pub fn is_power_of_two(self) -> bool

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

Examples

Basic usage:

assert!(U256::new(16).is_power_of_two());
assert!(!U256::new(10).is_power_of_two());
source

pub fn next_power_of_two(self) -> Self

Returns the smallest power of two greater than or equal to self.

When return value overflows (i.e., self > (1 << (N-1)) for type uN), it panics in debug mode and return value is wrapped to 0 in release mode (the only situation in which method can return 0).

Examples

Basic usage:

assert_eq!(U256::new(2).next_power_of_two(), U256::new(2));
assert_eq!(U256::new(3).next_power_of_two(), U256::new(4));
source

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

Returns the smallest power of two greater than or equal to n. If the next power of two is greater than the type’s maximum value, None is returned, otherwise the power of two is wrapped in Some.

Examples

Basic usage:

assert_eq!(U256::new(2).checked_next_power_of_two(), Some(U256::new(2)));
assert_eq!(U256::new(3).checked_next_power_of_two(), Some(U256::new(4)));
assert_eq!(U256::MAX.checked_next_power_of_two(), None);
source

pub fn to_be_bytes(self) -> [u8; 32]

Return the memory representation of this integer as a byte array in big endian (network) byte order.

Examples
let bytes = U256::from_words(
    0x00010203_04050607_08090a0b_0c0d0e0f,
    0x10111213_14151617_18191a1b_1c1d1e1f,
);
assert_eq!(
    bytes.to_be_bytes(),
    [
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
    ],
);
source

pub fn to_le_bytes(self) -> [u8; 32]

Return the memory representation of this integer as a byte array in little endian byte order.

Examples
let bytes = U256::from_words(
    0x00010203_04050607_08090a0b_0c0d0e0f,
    0x10111213_14151617_18191a1b_1c1d1e1f,
);
assert_eq!(
    bytes.to_le_bytes(),
    [
        0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
        0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
    ],
);
source

pub fn to_ne_bytes(self) -> [u8; 32]

Return the memory representation of this integer as a byte array in native byte order.

As the target platform’s native endianness is used, portable code should use to_be_bytes or to_le_bytes, as appropriate, instead.

Examples
let bytes = U256::from_words(
    0x00010203_04050607_08090a0b_0c0d0e0f,
    0x10111213_14151617_18191a1b_1c1d1e1f,
);
assert_eq!(
    bytes.to_ne_bytes(),
    if cfg!(target_endian = "big") {
        [
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
        ]
    } else {
        [
            0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
            0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
        ]
    }
);
source

pub fn from_be_bytes(bytes: [u8; 32]) -> Self

Create an integer value from its representation as a byte array in big endian.

Examples
let value = U256::from_be_bytes([
    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
]);
assert_eq!(
    value,
    U256::from_words(
        0x00010203_04050607_08090a0b_0c0d0e0f,
        0x10111213_14151617_18191a1b_1c1d1e1f,
    ),
);

When starting from a slice rather than an array, fallible conversion APIs can be used:

use std::convert::TryInto;

fn read_be_u256(input: &mut &[u8]) -> U256 {
    let (int_bytes, rest) = input.split_at(std::mem::size_of::<U256>());
    *input = rest;
    U256::from_be_bytes(int_bytes.try_into().unwrap())
}
source

pub fn from_le_bytes(bytes: [u8; 32]) -> Self

Create an integer value from its representation as a byte array in little endian.

Examples
let value = U256::from_le_bytes([
    0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
    0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
]);
assert_eq!(
    value,
    U256::from_words(
        0x00010203_04050607_08090a0b_0c0d0e0f,
        0x10111213_14151617_18191a1b_1c1d1e1f,
    ),
);

When starting from a slice rather than an array, fallible conversion APIs can be used:

use std::convert::TryInto;

fn read_be_u256(input: &mut &[u8]) -> U256 {
    let (int_bytes, rest) = input.split_at(std::mem::size_of::<U256>());
    *input = rest;
    U256::from_le_bytes(int_bytes.try_into().unwrap())
}
source

pub fn from_ne_bytes(bytes: [u8; 32]) -> Self

Create an integer value from its memory representation as a byte array in native endianness.

As the target platform’s native endianness is used, portable code likely wants to use from_be_bytes or from_le_bytes, as appropriate instead.

Examples
let value = U256::from_ne_bytes(if cfg!(target_endian = "big") {
    [
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
    ]
} else {
    [
        0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
        0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
    ]
});
assert_eq!(
    value,
    U256::from_words(
        0x00010203_04050607_08090a0b_0c0d0e0f,
        0x10111213_14151617_18191a1b_1c1d1e1f,
    ),
);

When starting from a slice rather than an array, fallible conversion APIs can be used:

use std::convert::TryInto;

fn read_be_u256(input: &mut &[u8]) -> U256 {
    let (int_bytes, rest) = input.split_at(std::mem::size_of::<U256>());
    *input = rest;
    U256::from_ne_bytes(int_bytes.try_into().unwrap())
}
source§

impl U256

source

pub const ZERO: Self = _

The additive identity for this integer type, i.e. 0.

source

pub const ONE: Self = _

The multiplicative identity for this integer type, i.e. 1.

source

pub const fn new(value: u128) -> Self

Creates a new 256-bit integer value from a primitive u128 integer.

source

pub const fn from_words(hi: u128, lo: u128) -> Self

Creates a new 256-bit integer value from high and low words.

source

pub const fn into_words(self) -> (u128, u128)

Splits a 256-bit integer into high and low words.

source

pub fn low(&self) -> &u128

Get the low 128-bit word for this unsigned integer.

source

pub fn low_mut(&mut self) -> &mut u128

Get the low 128-bit word for this unsigned integer as a mutable reference.

source

pub fn high(&self) -> &u128

Get the high 128-bit word for this unsigned integer.

source

pub fn high_mut(&mut self) -> &mut u128

Get the high 128-bit word for this unsigned integer as a mutable reference.

source

pub fn from_str_hex(src: &str) -> Result<Self, ParseIntError>

Converts a prefixed string slice in base 16 to an integer.

The string is expected to be an optional + sign followed by the 0x prefix and finally the digits. Leading and trailing whitespace represent an error.

Examples

Basic usage:

assert_eq!(U256::from_str_hex("0x2A"), Ok(U256::new(42)));
source

pub fn from_str_prefixed(src: &str) -> Result<Self, ParseIntError>

Converts a prefixed string slice in a base determined by the prefix to an integer.

The string is expected to be an optional + sign followed by the one of the supported prefixes and finally the digits. Leading and trailing whitespace represent an error. The base is determined based on the prefix:

  • 0b: base 2
  • 0o: base 8
  • 0x: base 16
  • no prefix: base 10
Examples

Basic usage:

assert_eq!(U256::from_str_prefixed("0b101"), Ok(U256::new(0b101)));
assert_eq!(U256::from_str_prefixed("0o17"), Ok(U256::new(0o17)));
assert_eq!(U256::from_str_prefixed("0xa"), Ok(U256::new(0xa)));
assert_eq!(U256::from_str_prefixed("42"), Ok(U256::new(42)));
source

pub const fn as_i8(self) -> i8

Cast to a primitive i8.

source

pub const fn as_i16(self) -> i16

Cast to a primitive i16.

source

pub const fn as_i32(self) -> i32

Cast to a primitive i32.

source

pub const fn as_i64(self) -> i64

Cast to a primitive i64.

source

pub const fn as_i128(self) -> i128

Cast to a primitive i128.

source

pub const fn as_i256(self) -> I256

Cast to a I256.

source

pub const fn as_u8(self) -> u8

Cast to a primitive u8.

source

pub const fn as_u16(self) -> u16

Cast to a primitive u16.

source

pub const fn as_u32(self) -> u32

Cast to a primitive u32.

source

pub const fn as_u64(self) -> u64

Cast to a primitive u64.

source

pub const fn as_u128(self) -> u128

Cast to a primitive u128.

source

pub const fn as_isize(self) -> isize

Cast to a primitive isize.

source

pub const fn as_usize(self) -> usize

Cast to a primitive usize.

source

pub fn as_f32(self) -> f32

Cast to a primitive f32.

source

pub fn as_f64(self) -> f64

Cast to a primitive f64.

Trait Implementations§

source§

impl Add<&U256> for &u128

§

type Output = U256

The resulting type after applying the + operator.
source§

fn add(self, rhs: &U256) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&U256> for U256

§

type Output = U256

The resulting type after applying the + operator.
source§

fn add(self, rhs: &U256) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&U256> for u128

§

type Output = U256

The resulting type after applying the + operator.
source§

fn add(self, rhs: &U256) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&u128> for &U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<&u128> for U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<U256> for &U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<U256> for &u128

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<U256> for u128

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<u128> for &U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<u128> for U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add for &U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add for U256

§

type Output = U256

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl AddAssign<&U256> for U256

source§

fn add_assign(&mut self, rhs: &U256)

Performs the += operation. Read more
source§

impl AddAssign<&u128> for U256

source§

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

Performs the += operation. Read more
source§

impl AddAssign<u128> for U256

source§

fn add_assign(&mut self, rhs: u128)

Performs the += operation. Read more
source§

impl AddAssign for U256

source§

fn add_assign(&mut self, rhs: U256)

Performs the += operation. Read more
source§

impl AsI256 for U256

source§

fn as_i256(self) -> I256

Perform an as conversion to a I256.
source§

impl AsU256 for U256

source§

fn as_u256(self) -> U256

Perform an as conversion to a U256.
source§

impl Binary for U256

source§

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

Formats the value using the given formatter.
source§

impl BitAnd<&U256> for &U256

§

type Output = U256

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &U256) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd<&U256> for &u128

§

type Output = U256

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &U256) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd<&U256> for U256

§

type Output = U256

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &U256) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd<&U256> for u128

§

type Output = U256

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: &U256) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd<&u128> for &U256

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd<&u128> for U256

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd<U256> for &U256

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd<U256> for &u128

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd<U256> for u128

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd<u128> for &U256

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd<u128> for U256

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAnd for U256

§

type Output = U256

The resulting type after applying the & operator.
source§

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

Performs the & operation. Read more
source§

impl BitAndAssign<&U256> for U256

source§

fn bitand_assign(&mut self, rhs: &U256)

Performs the &= operation. Read more
source§

impl BitAndAssign<&u128> for U256

source§

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

Performs the &= operation. Read more
source§

impl BitAndAssign<u128> for U256

source§

fn bitand_assign(&mut self, rhs: u128)

Performs the &= operation. Read more
source§

impl BitAndAssign for U256

source§

fn bitand_assign(&mut self, rhs: U256)

Performs the &= operation. Read more
source§

impl BitOr<&U256> for &U256

§

type Output = U256

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &U256) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr<&U256> for &u128

§

type Output = U256

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &U256) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr<&U256> for U256

§

type Output = U256

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &U256) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr<&U256> for u128

§

type Output = U256

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: &U256) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr<&u128> for &U256

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr<&u128> for U256

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr<U256> for &U256

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr<U256> for &u128

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr<U256> for u128

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr<u128> for &U256

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr<u128> for U256

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOr for U256

§

type Output = U256

The resulting type after applying the | operator.
source§

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

Performs the | operation. Read more
source§

impl BitOrAssign<&U256> for U256

source§

fn bitor_assign(&mut self, rhs: &U256)

Performs the |= operation. Read more
source§

impl BitOrAssign<&u128> for U256

source§

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

Performs the |= operation. Read more
source§

impl BitOrAssign<u128> for U256

source§

fn bitor_assign(&mut self, rhs: u128)

Performs the |= operation. Read more
source§

impl BitOrAssign for U256

source§

fn bitor_assign(&mut self, rhs: U256)

Performs the |= operation. Read more
source§

impl BitXor<&U256> for &U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &U256) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXor<&U256> for &u128

§

type Output = U256

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &U256) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXor<&U256> for U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &U256) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXor<&U256> for u128

§

type Output = U256

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: &U256) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXor<&u128> for &U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor<&u128> for U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor<U256> for &U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor<U256> for &u128

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor<U256> for u128

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor<u128> for &U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor<u128> for U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXor for U256

§

type Output = U256

The resulting type after applying the ^ operator.
source§

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

Performs the ^ operation. Read more
source§

impl BitXorAssign<&U256> for U256

source§

fn bitxor_assign(&mut self, rhs: &U256)

Performs the ^= operation. Read more
source§

impl BitXorAssign<&u128> for U256

source§

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

Performs the ^= operation. Read more
source§

impl BitXorAssign<u128> for U256

source§

fn bitxor_assign(&mut self, rhs: u128)

Performs the ^= operation. Read more
source§

impl BitXorAssign for U256

source§

fn bitxor_assign(&mut self, rhs: U256)

Performs the ^= operation. Read more
source§

impl Clone for U256

source§

fn clone(&self) -> U256

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for U256

source§

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

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

impl Default for U256

source§

fn default() -> U256

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for U256

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 Display for U256

source§

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

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

impl Div<&U256> for &u128

§

type Output = U256

The resulting type after applying the / operator.
source§

fn div(self, rhs: &U256) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&U256> for U256

§

type Output = U256

The resulting type after applying the / operator.
source§

fn div(self, rhs: &U256) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&U256> for u128

§

type Output = U256

The resulting type after applying the / operator.
source§

fn div(self, rhs: &U256) -> Self::Output

Performs the / operation. Read more
source§

impl Div<&u128> for &U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<&u128> for U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<U256> for &U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<U256> for &u128

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<U256> for u128

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<u128> for &U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div<u128> for U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div for &U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Div for U256

§

type Output = U256

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl DivAssign<&U256> for U256

source§

fn div_assign(&mut self, rhs: &U256)

Performs the /= operation. Read more
source§

impl DivAssign<&u128> for U256

source§

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

Performs the /= operation. Read more
source§

impl DivAssign<u128> for U256

source§

fn div_assign(&mut self, rhs: u128)

Performs the /= operation. Read more
source§

impl DivAssign for U256

source§

fn div_assign(&mut self, rhs: U256)

Performs the /= operation. Read more
source§

impl From<U256> for f32

source§

fn from(x: U256) -> f32

Converts to this type from the input type.
source§

impl From<U256> for f64

source§

fn from(x: U256) -> f64

Converts to this type from the input type.
source§

impl From<bool> for U256

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<u128> for U256

source§

fn from(value: u128) -> Self

Converts to this type from the input type.
source§

impl From<u16> for U256

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for U256

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for U256

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for U256

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl FromStr for U256

§

type Err = ParseIntError

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

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

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

impl Hash for U256

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 LowerExp for U256

source§

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

Formats the value using the given formatter.
source§

impl LowerHex for U256

source§

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

Formats the value using the given formatter.
source§

impl Mul<&U256> for &u128

§

type Output = U256

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &U256) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&U256> for U256

§

type Output = U256

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &U256) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&U256> for u128

§

type Output = U256

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &U256) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<&u128> for &U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<&u128> for U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<U256> for &U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<U256> for &u128

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<U256> for u128

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<u128> for &U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<u128> for U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul for &U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul for U256

§

type Output = U256

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl MulAssign<&U256> for U256

source§

fn mul_assign(&mut self, rhs: &U256)

Performs the *= operation. Read more
source§

impl MulAssign<&u128> for U256

source§

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

Performs the *= operation. Read more
source§

impl MulAssign<u128> for U256

source§

fn mul_assign(&mut self, rhs: u128)

Performs the *= operation. Read more
source§

impl MulAssign for U256

source§

fn mul_assign(&mut self, rhs: U256)

Performs the *= operation. Read more
source§

impl Not for &U256

§

type Output = U256

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Not for U256

§

type Output = U256

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Octal for U256

source§

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

Formats the value using the given formatter.
source§

impl Ord for U256

source§

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

This method returns an Ordering between self and other. Read more
1.21.0 · source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

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

impl PartialEq<U256> for u128

source§

fn eq(&self, other: &U256) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u128> for U256

source§

fn eq(&self, other: &u128) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for U256

source§

fn eq(&self, other: &U256) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<U256> for u128

source§

fn partial_cmp(&self, rhs: &U256) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u128> for U256

source§

fn partial_cmp(&self, rhs: &u128) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd for U256

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 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a> Product<&'a U256> for U256

source§

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

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl Product for U256

source§

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

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl Rem<&U256> for &u128

§

type Output = U256

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &U256) -> Self::Output

Performs the % operation. Read more
source§

impl Rem<&U256> for U256

§

type Output = U256

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &U256) -> Self::Output

Performs the % operation. Read more
source§

impl Rem<&U256> for u128

§

type Output = U256

The resulting type after applying the % operator.
source§

fn rem(self, rhs: &U256) -> Self::Output

Performs the % operation. Read more
source§

impl Rem<&u128> for &U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<&u128> for U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<U256> for &U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<U256> for &u128

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<U256> for u128

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<u128> for &U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem<u128> for U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem for &U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Rem for U256

§

type Output = U256

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl RemAssign<&U256> for U256

source§

fn rem_assign(&mut self, rhs: &U256)

Performs the %= operation. Read more
source§

impl RemAssign<&u128> for U256

source§

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

Performs the %= operation. Read more
source§

impl RemAssign<u128> for U256

source§

fn rem_assign(&mut self, rhs: u128)

Performs the %= operation. Read more
source§

impl RemAssign for U256

source§

fn rem_assign(&mut self, rhs: U256)

Performs the %= operation. Read more
source§

impl Serialize for U256

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 Shl<&I256> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&I256> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&U256> for &I256

§

type Output = I256

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

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

Performs the << operation. Read more
source§

impl Shl<&U256> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&U256> for I256

§

type Output = I256

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

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

Performs the << operation. Read more
source§

impl Shl<&U256> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i128> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i128> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i16> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i16> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i32> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i32> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i64> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i64> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i8> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&i8> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&isize> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&isize> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u128> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u128> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u16> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u16> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u32> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u32> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u64> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u64> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u8> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&u8> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&usize> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<&usize> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<I256> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<I256> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<U256> for &I256

§

type Output = I256

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

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

Performs the << operation. Read more
source§

impl Shl<U256> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<U256> for I256

§

type Output = I256

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

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

Performs the << operation. Read more
source§

impl Shl<i128> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i128> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i16> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i16> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i32> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i32> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i64> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i64> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i8> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<i8> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<isize> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<isize> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u128> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u128> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u16> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u16> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u32> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u32> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u64> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u64> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u8> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<u8> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<usize> for &U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl<usize> for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl Shl for U256

§

type Output = U256

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

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

Performs the << operation. Read more
source§

impl ShlAssign<&I256> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&U256> for I256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&U256> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&i128> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&i16> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&i32> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&i64> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&i8> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&isize> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&u128> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&u16> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&u32> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&u64> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&u8> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<&usize> for U256

source§

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

Performs the <<= operation. Read more
source§

impl ShlAssign<I256> for U256

source§

fn shl_assign(&mut self, rhs: I256)

Performs the <<= operation. Read more
source§

impl ShlAssign<U256> for I256

source§

fn shl_assign(&mut self, rhs: U256)

Performs the <<= operation. Read more
source§

impl ShlAssign<i128> for U256

source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
source§

impl ShlAssign<i16> for U256

source§

fn shl_assign(&mut self, rhs: i16)

Performs the <<= operation. Read more
source§

impl ShlAssign<i32> for U256

source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
source§

impl ShlAssign<i64> for U256

source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
source§

impl ShlAssign<i8> for U256

source§

fn shl_assign(&mut self, rhs: i8)

Performs the <<= operation. Read more
source§

impl ShlAssign<isize> for U256

source§

fn shl_assign(&mut self, rhs: isize)

Performs the <<= operation. Read more
source§

impl ShlAssign<u128> for U256

source§

fn shl_assign(&mut self, rhs: u128)

Performs the <<= operation. Read more
source§

impl ShlAssign<u16> for U256

source§

fn shl_assign(&mut self, rhs: u16)

Performs the <<= operation. Read more
source§

impl ShlAssign<u32> for U256

source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
source§

impl ShlAssign<u64> for U256

source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
source§

impl ShlAssign<u8> for U256

source§

fn shl_assign(&mut self, rhs: u8)

Performs the <<= operation. Read more
source§

impl ShlAssign<usize> for U256

source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
source§

impl ShlAssign for U256

source§

fn shl_assign(&mut self, rhs: U256)

Performs the <<= operation. Read more
source§

impl Shr<&I256> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&I256> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&U256> for &I256

§

type Output = I256

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

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

Performs the >> operation. Read more
source§

impl Shr<&U256> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&U256> for I256

§

type Output = I256

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

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

Performs the >> operation. Read more
source§

impl Shr<&U256> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i128> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i128> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i16> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i16> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i32> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i32> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i64> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i64> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i8> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&i8> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&isize> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&isize> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u128> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u128> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u16> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u16> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u32> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u32> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u64> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u64> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u8> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&u8> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&usize> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<&usize> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<I256> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<I256> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<U256> for &I256

§

type Output = I256

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

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

Performs the >> operation. Read more
source§

impl Shr<U256> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<U256> for I256

§

type Output = I256

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

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

Performs the >> operation. Read more
source§

impl Shr<i128> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i128> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i16> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i16> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i32> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i32> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i64> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i64> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i8> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<i8> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<isize> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<isize> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u128> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u128> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u16> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u16> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u32> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u32> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u64> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u64> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u8> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<u8> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<usize> for &U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr<usize> for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl Shr for U256

§

type Output = U256

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

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

Performs the >> operation. Read more
source§

impl ShrAssign<&I256> for U256

source§

fn shr_assign(&mut self, rhs: &I256)

Performs the >>= operation. Read more
source§

impl ShrAssign<&U256> for I256

source§

fn shr_assign(&mut self, rhs: &U256)

Performs the >>= operation. Read more
source§

impl ShrAssign<&U256> for U256

source§

fn shr_assign(&mut self, rhs: &U256)

Performs the >>= operation. Read more
source§

impl ShrAssign<&i128> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&i16> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&i32> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&i64> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&i8> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&isize> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&u128> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&u16> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&u32> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&u64> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&u8> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<&usize> for U256

source§

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

Performs the >>= operation. Read more
source§

impl ShrAssign<I256> for U256

source§

fn shr_assign(&mut self, rhs: I256)

Performs the >>= operation. Read more
source§

impl ShrAssign<U256> for I256

source§

fn shr_assign(&mut self, rhs: U256)

Performs the >>= operation. Read more
source§

impl ShrAssign<i128> for U256

source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
source§

impl ShrAssign<i16> for U256

source§

fn shr_assign(&mut self, rhs: i16)

Performs the >>= operation. Read more
source§

impl ShrAssign<i32> for U256

source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
source§

impl ShrAssign<i64> for U256

source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
source§

impl ShrAssign<i8> for U256

source§

fn shr_assign(&mut self, rhs: i8)

Performs the >>= operation. Read more
source§

impl ShrAssign<isize> for U256

source§

fn shr_assign(&mut self, rhs: isize)

Performs the >>= operation. Read more
source§

impl ShrAssign<u128> for U256

source§

fn shr_assign(&mut self, rhs: u128)

Performs the >>= operation. Read more
source§

impl ShrAssign<u16> for U256

source§

fn shr_assign(&mut self, rhs: u16)

Performs the >>= operation. Read more
source§

impl ShrAssign<u32> for U256

source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
source§

impl ShrAssign<u64> for U256

source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
source§

impl ShrAssign<u8> for U256

source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
source§

impl ShrAssign<usize> for U256

source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
source§

impl ShrAssign for U256

source§

fn shr_assign(&mut self, rhs: U256)

Performs the >>= operation. Read more
source§

impl Sub<&U256> for &u128

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &U256) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&U256> for U256

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &U256) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&U256> for u128

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &U256) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<&u128> for &U256

§

type Output = U256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<&u128> for U256

§

type Output = U256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<U256> for &U256

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: U256) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<U256> for &u128

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: U256) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<U256> for u128

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: U256) -> Self::Output

Performs the - operation. Read more
source§

impl Sub<u128> for &U256

§

type Output = U256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub<u128> for U256

§

type Output = U256

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl Sub for &U256

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for U256

§

type Output = U256

The resulting type after applying the - operator.
source§

fn sub(self, rhs: U256) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign<&U256> for U256

source§

fn sub_assign(&mut self, rhs: &U256)

Performs the -= operation. Read more
source§

impl SubAssign<&u128> for U256

source§

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

Performs the -= operation. Read more
source§

impl SubAssign<u128> for U256

source§

fn sub_assign(&mut self, rhs: u128)

Performs the -= operation. Read more
source§

impl SubAssign for U256

source§

fn sub_assign(&mut self, rhs: U256)

Performs the -= operation. Read more
source§

impl<'a> Sum<&'a U256> for U256

source§

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

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Sum for U256

source§

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

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl TryFrom<I256> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: I256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for I256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for i128

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for i16

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for i32

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for i64

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for i8

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for isize

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for u128

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for u16

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for u32

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for u64

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for u8

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<U256> for usize

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(x: U256) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i128> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: i128) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i16> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: i16) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i32> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i64> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: i64) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i8> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: i8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<isize> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: isize) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<usize> for U256

§

type Error = TryFromIntError

The type returned in the event of a conversion error.
source§

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl UpperExp for U256

source§

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

Formats the value using the given formatter.
source§

impl UpperHex for U256

source§

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

Formats the value using the given formatter.
source§

impl Copy for U256

source§

impl Eq for U256

source§

impl StructuralEq for U256

source§

impl StructuralPartialEq for U256

Auto Trait Implementations§

§

impl RefUnwindSafe for U256

§

impl Send for U256

§

impl Sync for U256

§

impl Unpin for U256

§

impl UnwindSafe for U256

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: for<'de> Deserialize<'de>,