Struct elrond_wasm::types::H256[][src]

pub struct H256(_);
Expand description

Type that holds 32 bytes of data. Data is kept on the heap to keep wasm size low and avoid copies.

Implementations

Returns a new zero-initialized fixed hash. Allocates directly in heap. Minimal resulting wasm code (14 bytes if not inlined).

Returns the size of this hash in bytes.

Extracts a byte slice containing the entire fixed hash.

Pointer to the data on the heap.

Returns an unsafe mutable pointer to the data on the heap. Used by the API to populate data.

True if all 32 bytes of the hash are zero.

Transmutes self to an (in principle) variable length boxed bytes object. Both BoxedBytes and H256 keep the data on the heap, so only the pointer to that data needs to be transmuted. Does not reallocate or copy data, the data on the heap remains untouched.

Trait Implementations

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. 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.

Performs the conversion.

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.

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

Attempt to deserialise the value from input, using the format of an object nested inside another structure. In case of success returns the deserialized value and the number of bytes consumed during the operation. Read more

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller implementations in cases where the application is supposed to exit directly on decode error. Read more

NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version. Read more

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller implementations in cases where the application is supposed to exit directly on decode error. Read more

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

This method tests for !=.

Attempt to deserialize the value from input.

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller implementations in cases where the application is supposed to exit directly on decode error. Read more

Attempt to serialize the value to ouput.

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller bytecode implementations in cases where the application is supposed to exit directly on decode error. Read more

A type can provide more than its own description. For instance, a struct can also provide the descriptions of the type of its fields. TypeAbi doesn’t care for the exact accumulator type, which is abstracted by the TypeDescriptionContainer trait. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.