#[repr(C)]
pub struct H256(_);
Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
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
.
The given bytes are interpreted in big endian order.
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
.
The given bytes are interpreted in big endian order.
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.
Utilities using the byteorder
crate.
Returns the lowest 8 bytes interpreted as big-endian.
For hash type with less than 8 bytes the missing bytes
are interpreted as being zero.
Returns the lowest 8 bytes interpreted as little-endian.
For hash type with less than 8 bytes the missing bytes
are interpreted as being zero.
Returns the lowest 8 bytes interpreted as native-endian.
For hash type with less than 8 bytes the missing bytes
are interpreted as being zero.
Creates a new hash type from the given u64
value.
- The given
u64
value is interpreted as big endian.
- Ignores the most significant bits of the given value
if the hash type has less than 8 bytes.
Creates a new hash type from the given u64
value.
- The given
u64
value is interpreted as little endian.
- Ignores the most significant bits of the given value
if the hash type has less than 8 bytes.
Creates a new hash type from the given u64
value.
- The given
u64
value is interpreted as native endian.
- Ignores the most significant bits of the given value
if the hash type has less than 8 bytes.
Utilities using the rand
crate.
Assign self
to a cryptographically random value using the
given random number generator.
Assign self
to a cryptographically random value.
Create a new hash with cryptographically random content using the
given random number generator.
Create a new hash with cryptographically random content.
Constructs a hash type from the given bytes array of fixed length.
The given bytes are interpreted in big endian order.
Constructs a hash type from the given reference
to the bytes array of fixed length.
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.
The given bytes are interpreted in big endian order.
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
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter.
Formats the value using the given formatter.
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
The resulting type after applying the &
operator.
Performs the &
operation.
The resulting type after applying the &
operator.
Performs the &
operation.
The resulting type after applying the |
operator.
Performs the |
operation.
The resulting type after applying the |
operator.
Performs the |
operation.
The resulting type after applying the ^
operator.
Performs the ^
operation.
The resulting type after applying the ^
operator.
Performs the ^
operation.
Performs the &=
operation.
Performs the &=
operation.
Performs the |=
operation.
Performs the |=
operation.
Performs the ^=
operation.
Performs the ^=
operation.
The returned type after indexing.
Performs the indexing (container[index]
) operation.
Performs the mutable indexing (container[index]
) operation.
type Err = FromHexError
The associated error which can be returned from parsing.
Creates a hash type instance from the given string.
The given input string is interpreted in big endian.
- When encountering invalid non hex-digits
- Upon empty string input or invalid input length in general
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more
Convert self to a slice and then invoke the given closure with it.
Convert self to a slice and append it to the destination.
Convert self to an owned vector.
Attempt to deserialise the value from input.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Deprecated since 0.5.0:
replaced by distributions::Standard
Generates a random instance of this type using the specified source of randomness. Read more
impl<S> Codec for S where S: Encode + Decode, | |
impl<T> KeyedVec for T where T: Codec, | |