Struct amplify_num::u256[][src]

pub struct u256(_);
Expand description

Large integer type

The type is composed of little-endian ordered 64-bit words, which represents its inner representation.

Implementations

Converts the object to a raw pointer

Converts the object to a mutable raw pointer

Returns the underlying array of words constituting large integer

Returns the underlying array of words constituting large integer

Constructs integer type from the underlying array of words.

Zero value

Value for 1

Minimum value

Maximum value

Bit dimension

Length of the integer in bytes

Length of the inner representation in 64-bit words

Returns whether specific bit number is set to 1 or not

Returns lower 32 bits of the number as u32

Returns lower 64 bits of the number as u32

Return the least number of bits needed to represent the number

Creates the integer value from a byte array using big-endian encoding

Creates the integer value from a byte slice using big-endian encoding

Creates the integer value from a byte array using little-endian encoding

Creates the integer value from a byte slice using little-endian encoding

Convert the integer into a byte array using big-endian encoding

Convert a integer into a byte array using little-endian encoding

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

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

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.

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

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

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

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.

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

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

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

Calculates self * 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.

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

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

The resulting type after applying the & operator.

Performs the & operation. Read more

Performs the &= operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

Performs the |= operation. Read more

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

Performs the ^= operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

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

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

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

Restrict a value to a certain interval. Read more

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

This method tests for !=.

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

The resulting type after applying the % operator.

Performs the % operation. Read more

Performs the %= operation. Read more

The resulting type after applying the << operator.

Performs the << operation. Read more

Performs the <<= operation. Read more

The resulting type after applying the >> operator.

Performs the >> operation. Read more

Performs the >>= operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.