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§
Trait Implementations§
source§impl<'a> TopDecodeMultiInput for HexCallDataDeserializer<'a>
impl<'a> TopDecodeMultiInput for HexCallDataDeserializer<'a>
type ValueInput = Box<[u8], Global>
source§fn next_value_input<H>(
&mut self,
h: H
) -> Result<Self::ValueInput, H::HandledErr>where
H: DecodeErrorHandler,
fn next_value_input<H>(
&mut self,
h: H
) -> Result<Self::ValueInput, H::HandledErr>where
H: DecodeErrorHandler,
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 morefn next_value<T, H>(
&mut self,
h: H
) -> Result<T, <H as DecodeErrorHandler>::HandledErr>where
T: TopDecode,
H: DecodeErrorHandler,
source§fn assert_no_more_args<H>(
&self,
h: H
) -> Result<(), <H as DecodeErrorHandler>::HandledErr>where
H: DecodeErrorHandler,
fn assert_no_more_args<H>(
&self,
h: H
) -> Result<(), <H as DecodeErrorHandler>::HandledErr>where
H: DecodeErrorHandler,
Called after retrieving all arguments to validate that extra arguments were not provided.
source§fn flush_ignore<H>(
&mut self,
h: H
) -> Result<(), <H as DecodeErrorHandler>::HandledErr>where
H: DecodeErrorHandler,
fn flush_ignore<H>(
&mut self,
h: H
) -> Result<(), <H as DecodeErrorHandler>::HandledErr>where
H: DecodeErrorHandler,
Consumes all inputs and ignores them.
After executing this, assert_no_more_args should not fail. Read more