Struct ethereum_types::U256[]

#[repr(C)]
pub struct U256(pub [u64; 4]);

Little-endian large integer type

Methods

impl U256

MAX: U256 = U256([<u64>::max_value(); 4])

Maximum value.

Convert from a decimal string.

Conversion to u32

Low word (u64)

Conversion to u32 with overflow checking

Panics

Panics if the number is larger than 2^32.

Conversion to u64 with overflow checking

Panics

Panics if the number is larger than u64::max_value().

Conversion to usize with overflow checking

Panics

Panics if the number is larger than usize::max_value().

Whether this is zero.

Return the least number of bits needed to represent the number

Return if specific bit is set.

Panics

Panics if index exceeds the bit width of the number.

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

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

Return specific byte.

Panics

Panics if index exceeds the byte width of the number.

Write to the slice in big-endian format.

Write to the slice in little-endian format.

Create 10**n as this type.

Panics

Panics if the result overflows the type.

Zero (additive identity) of this type.

One (multiplicative identity) of this type.

The maximum value which can be inhabited by this type.

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

Panics

Panics if the result overflows the type.

Fast exponentation by squaring. Returns result and overflow flag.

Add with overflow.

Addition which saturates at the maximum value (Self::max_value()).

Checked addition. Returns None if overflow occurred.

Subtraction which underflows and returns a flag if it does.

Subtraction which saturates at zero.

Checked subtraction. Returns None if overflow occurred.

Multiply with overflow, returning a flag if it does.

Multiplication which saturates at the maximum value..

Checked multiplication. Returns None if overflow occurred.

Checked division. Returns None if other == 0.

Checked modulus. Returns None if other == 0.

Negation with overflow.

Checked negation. Returns None unless self == 0.

Deprecated

: Use Mul<u32> instead.

Multiplication by u32.

Deprecated

: Use LowerHex instead.

Convert to hex string.

Converts from big endian representation bytes in memory.

Converts from little endian representation bytes in memory.

impl U256
[src]

Multiplies two 256-bit integers to produce full 512-bit integer No overflow possible

Trait Implementations

impl From<U256> for H256
[src]

Performs the conversion.

impl<'a> From<&'a U256> for H256
[src]

Performs the conversion.

impl From<H256> for U256
[src]

Performs the conversion.

impl<'a> From<&'a H256> for U256
[src]

Performs the conversion.

impl Copy for U256

impl Clone for U256

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for U256

impl PartialEq for U256

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Hash for U256

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl AsRef<U256> for U256

Performs the conversion.

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

Performs the conversion.

impl From<U256> for [u8; 32]

Performs the conversion.

impl From<[u8; 32]> for U256

Performs the conversion.

impl<'a> From<&'a [u8; 32]> for U256

Performs the conversion.

impl Default for U256

Returns the "default value" for a type. Read more

impl From<u64> for U256

Performs the conversion.

impl From<u8> for U256

Performs the conversion.

impl From<u16> for U256

Performs the conversion.

impl From<u32> for U256

Performs the conversion.

impl From<usize> for U256

Performs the conversion.

impl From<i64> for U256

Performs the conversion.

impl From<i8> for U256

Performs the conversion.

impl From<i16> for U256

Performs the conversion.

impl From<i32> for U256

Performs the conversion.

impl From<isize> for U256

Performs the conversion.

impl<'a> From<&'a [u8]> for U256

Performs the conversion.

impl<T> Add<T> for U256 where
    T: Into<U256>, 

The resulting type after applying the + operator.

Performs the + operation.

impl<'a, T> Add<T> for &'a U256 where
    T: Into<U256>, 

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<U256> for U256

Performs the += operation.

impl<T> Sub<T> for U256 where
    T: Into<U256>, 

The resulting type after applying the - operator.

Performs the - operation.

impl<'a, T> Sub<T> for &'a U256 where
    T: Into<U256>, 

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<U256> for U256

Performs the -= operation.

impl Mul<u32> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<u32> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl MulAssign<u32> for U256

Performs the *= operation.

impl Mul<u8> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a u8> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a u8> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<u8> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<u16> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a u16> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a u16> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<u16> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<u64> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a u64> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a u64> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<u64> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<usize> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a usize> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a usize> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<usize> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<i8> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a i8> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a i8> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<i8> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<i16> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a i16> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a i16> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<i16> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<i64> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a i64> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a i64> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<i64> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<isize> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a isize> for U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<&'a isize> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<isize> for &'a U256

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<U256> for U256

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

impl MulAssign<u8> for U256

Performs the *= operation.

impl MulAssign<u16> for U256

Performs the *= operation.

impl MulAssign<u64> for U256

Performs the *= operation.

impl MulAssign<usize> for U256

Performs the *= operation.

impl MulAssign<i8> for U256

Performs the *= operation.

impl MulAssign<i16> for U256

Performs the *= operation.

impl MulAssign<i64> for U256

Performs the *= operation.

impl MulAssign<isize> for U256

Performs the *= operation.

impl MulAssign<U256> for U256

Performs the *= operation.

impl<T> Div<T> for U256 where
    T: Into<U256>, 

The resulting type after applying the / operator.

Performs the / operation.

impl<'a, T> Div<T> for &'a U256 where
    T: Into<U256>, 

The resulting type after applying the / operator.

Performs the / operation.

impl<T> DivAssign<T> for U256 where
    T: Into<U256>, 

Performs the /= operation.

impl<T> Rem<T> for U256 where
    T: Into<U256> + Copy

The resulting type after applying the % operator.

Performs the % operation.

impl<'a, T> Rem<T> for &'a U256 where
    T: Into<U256> + Copy

The resulting type after applying the % operator.

Performs the % operation.

impl<T> RemAssign<T> for U256 where
    T: Into<U256> + Copy

Performs the %= operation.

impl BitAnd<U256> for U256

The resulting type after applying the & operator.

Performs the & operation.

impl BitXor<U256> for U256

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl BitOr<U256> for U256

The resulting type after applying the | operator.

Performs the | operation.

impl Not for U256

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl<T> Shl<T> for U256 where
    T: Into<U256>, 

The resulting type after applying the << operator.

Performs the << operation.

impl<'a, T> Shl<T> for &'a U256 where
    T: Into<U256>, 

The resulting type after applying the << operator.

Performs the << operation.

impl<T> ShlAssign<T> for U256 where
    T: Into<U256>, 

Performs the <<= operation.

impl<T> Shr<T> for U256 where
    T: Into<U256>, 

The resulting type after applying the >> operator.

Performs the >> operation.

impl<'a, T> Shr<T> for &'a U256 where
    T: Into<U256>, 

The resulting type after applying the >> operator.

Performs the >> operation.

impl<T> ShrAssign<T> for U256 where
    T: Into<U256>, 

Performs the >>= operation.

impl Ord for U256

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for U256

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

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

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

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

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

impl Debug for U256

Formats the value using the given formatter. Read more

impl Display for U256

Formats the value using the given formatter. Read more

impl FromStr for U256

The associated error which can be returned from parsing.

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

impl LowerHex for U256

Formats the value using the given formatter.

impl From<&'static str> for U256

Performs the conversion.

impl HeapSizeOf for U256

Measure the size of any heap-allocated structures that hang off this value, but not the space taken up by the value itself (i.e. what size_of:: measures, more or less); that space is handled by the implementation of HeapSizeOf for Box below. Read more

impl Serialize for U256
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for U256
[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<U256> for U512
[src]

Performs the conversion.

impl From<U512> for U256
[src]

Performs the conversion.

impl<'a> From<&'a U256> for U512
[src]

Performs the conversion.

impl<'a> From<&'a U512> for U256
[src]

Performs the conversion.

impl From<U256> for U128
[src]

Performs the conversion.

impl From<U128> for U256
[src]

Performs the conversion.

impl From<U256> for u64
[src]

Performs the conversion.

impl From<U256> for u32
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for U256

impl Sync for U256