Struct primitive_types::H256

source ·
#[repr(C)]
pub struct H256(pub [u8; 32]);
Expand description

Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.

Tuple Fields§

§0: [u8; 32]

Implementations§

Returns a new fixed hash where all bits are set to the given byte.

Returns a new zero-initialized fixed hash.

Returns the size of this hash in bytes.

Extracts a byte slice containing the entire fixed hash.

Extracts a mutable byte slice containing the entire fixed hash.

Extracts a reference to the byte array containing the entire fixed hash.

Extracts a reference to the byte array containing the entire fixed hash.

Returns the inner bytes array.

Returns a constant raw pointer to the value.

Returns a mutable raw pointer to the value.

Assign the bytes from the byte slice src to self.

Note

The given bytes are interpreted in big endian order.

Panics

If the length of src and the number of bytes in self do not match.

Create a new fixed-hash from the given slice src.

Note

The given bytes are interpreted in big endian order.

Panics

If the length of src and the number of bytes in Self do not match.

Returns true if all bits set in b are also set in self.

Returns true if no bits are set.

Trait Implementations§

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
Performs the &= operation. Read more
Performs the &= operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
Performs the |= operation. Read more
Performs the |= operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
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

Constructs a hash type from the given reference to the bytes array of fixed length.

Note

The given bytes are interpreted in big endian order.

Constructs a hash type from the given reference to the mutable bytes array of fixed length.

Note

The given bytes are interpreted in big endian order.

Constructs a hash type from the given bytes array of fixed length.

Note

The given bytes are interpreted in big endian order.

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
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
Performs the mutable indexing (container[index]) operation. Read more
Formats the value using the given formatter.
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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Formats the value using the given formatter.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca) Read more
Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA) Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.