Struct ethereum_types::U512 [−][src]
Expand description
Little-endian large integer type 512-bits unsigned integer.
Tuple Fields
0: [u64; 8]
Implementations
Converts a string slice in a given base to an integer. Only supports radixes of 10 and 16.
Convert from a decimal string.
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().
Returns the number of leading zeros in the binary representation of self.
Returns the number of trailing zeros in the binary representation of self.
Write to the slice in big-endian format.
Write to the slice in little-endian format.
Compute the highest n
such that n * n <= self
.
Fast exponentiation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring
Panics
Panics if the result overflows the type.
Fast exponentiation by squaring. Returns result and overflow flag.
Checked exponentiation. Returns None
if overflow occurred.
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
.
Checked negation. Returns None
unless self == 0
.
Converts from big endian representation bytes in memory.
Trait Implementations
Performs the +=
operation. Read more
Get a reference to the underlying little-endian words.
Attempt to deserialise the value from input.
Attempt to skip the encoded value from input. Read more
fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
pub fn deserialize<D>(
deserializer: D
) -> Result<U512, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<U512, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the /=
operation. Read more
Append a value to the stream
fn rlp_bytes(&self) -> BytesMut
fn rlp_bytes(&self) -> BytesMut
Get rlp-encoded bytes for this instance
Convert self to a slice and then invoke the given closure with it.
Convert self to a slice and append it to the destination.
fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Upper bound, in bytes, of the maximum encoded size of this item.
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
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
Performs the %=
operation. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Performs the <<=
operation. Read more
Performs the >>=
operation. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for U512
impl UnwindSafe for U512
Blanket Implementations
pub fn as_byte_slice(&self) -> &[u8]
Mutably borrows from an owned value. Read more