Expand description
Little-endian large integer type 256-bit unsigned integer.
Tuple Fields
0: [u64; 4]
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.
pub fn deserialize<D>(
deserializer: D
) -> Result<U256, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<U256, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the /=
operation. 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 U256
impl UnwindSafe for U256
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
The counterpart to unchecked_from
.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more