pub struct HexCallDataDeserializer<'a> { /* private fields */ }
Expand description

Deserializes from Elrond’s smart contract call format.

This format consists of the function name, followed by ‘@’, follwed by hex-encoded argument bytes separated by ‘@’ characters. Example: “funcName@00000@aaaa@1234@@”. Arguments can be empty. Argument hex encodings must always have an even number of digits.

HexCallDataDeserializer borrows its input and will allocate new Vecs for each output.

Converting from bytes to specific argument types is not in scope. The TopDecodeMulti trait deals with that.

Currently not used anywhere in the framework, but the functionality is available for anyone who needs it.

Implementations§

Gets the first component of the call data, which is the function name. Unlike the arguments, this can be called at any time.

Gets the next argument, deserializes from hex and returns the resulting bytes.

Trait Implementations§

Check if there are more arguments that can be loaded.
Retrieves an input for deserializing an argument. If the loader is out of arguments, it will crash by itself with an appropriate error, without returning. Use if the next argument is optional, use has_next beforehand. Read more
Called after retrieving all arguments to validate that extra arguments were not provided.
Consumes all inputs and ignores them. After executing this, assert_no_more_args should not fail. 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

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.