Struct elrond_codec::Empty

source ·
pub struct Empty;
Expand description

Empty structure with an empty bytes representation. Equivalent to false, 0 or [u8; 0], but more explicit.

Note: the unit type () would have naturally fit this role, but we decided to make the unit type multi-value only.

Trait Implementations§

Formats the value using the given formatter. Read more
Version of dep_decode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode. 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 dep_encode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode. Read more
NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version. 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
Version of top_decode that can handle errors as soon as they occur. For instance it can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode. Read more
Attempt to deserialize the value from input.
Version of top_encode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode. Read more
Attempt to serialize the value to ouput.

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.

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.