Struct ethereum_types::U512 []

#[repr(C)]
pub struct U512(pub [u64; 8]);

Little-endian large integer type

Methods

impl U512

Convert from a decimal string.

Conversion to u32

Conversion to 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 2^64.

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 https://en.wikipedia.org/wiki/Exponentiation_by_squaring

Optimized instructions

Addition which saturates at the maximum 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.

Division with overflow

Checked division. Returns None if other == 0.

Modulus with overflow.

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 Can also be used as (&slice).into(), as it is default From slice implementation for U256

Converts from little endian representation bytes in memory

Trait Implementations

impl From<U512> for H512
[src]

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl From<H512> for U512
[src]

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl Copy for U512

impl Clone for U512

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for U512

impl PartialEq for U512

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

This method tests for !=.

impl Hash for U512

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

1.3.0
[src]

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

impl AsRef<U512> for U512

Performs the conversion.

impl Default for U512

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

impl From<u64> for U512

Performs the conversion.

impl From<u8> for U512

Performs the conversion.

impl From<u16> for U512

Performs the conversion.

impl From<u32> for U512

Performs the conversion.

impl From<usize> for U512

Performs the conversion.

impl From<i64> for U512

Performs the conversion.

impl From<i8> for U512

Performs the conversion.

impl From<i16> for U512

Performs the conversion.

impl From<i32> for U512

Performs the conversion.

impl From<isize> for U512

Performs the conversion.

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

Performs the conversion.

impl Add<U512> for U512

The resulting type after applying the + operator.

Performs the + operation.

impl Sub<U512> for U512

The resulting type after applying the - operator.

Performs the - operation.

impl Mul<u32> for U512

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<U512> for U512

The resulting type after applying the * operator.

Performs the * operation.

impl Div<U512> for U512

The resulting type after applying the / operator.

Performs the / operation.

impl Rem<U512> for U512

The resulting type after applying the % operator.

Performs the % operation.

impl BitAnd<U512> for U512

The resulting type after applying the & operator.

Performs the & operation.

impl BitXor<U512> for U512

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl BitOr<U512> for U512

The resulting type after applying the | operator.

Performs the | operation.

impl Not for U512

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl Shl<usize> for U512

The resulting type after applying the << operator.

Performs the << operation.

impl Shr<usize> for U512

The resulting type after applying the >> operator.

Performs the >> operation.

impl Ord for U512

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

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialOrd for U512

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

impl Debug for U512

Formats the value using the given formatter. Read more

impl Display for U512

Formats the value using the given formatter. Read more

impl FromStr for U512

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 U512

Formats the value using the given formatter.

impl From<&'static str> for U512

Performs the conversion.

impl HeapSizeOf for U512

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 U512
[src]

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<U256> for U512
[src]

[src]

Performs the conversion.

impl From<U512> for U256
[src]

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl From<U512> for U128
[src]

[src]

Performs the conversion.

impl From<U128> for U512
[src]

[src]

Performs the conversion.

impl<'a> From<&'a [u8; 64]> for U512
[src]

[src]

Performs the conversion.

impl From<[u8; 64]> for U512
[src]

[src]

Performs the conversion.

impl From<U512> for [u8; 64]
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for U512

impl Sync for U512