[−][src]Trait elrond_wasm::io::dyn_arg_input::DynArgInput
Abstracts away the loading of multi-arguments. Acts as an abstract source for these arguments.
The main method, next_arg_input
will provide a decode input,
from which any deserializable object can be deserialized.
Structs implementing this trait are also responsible with error handling, such as:
- deserialization errors
- insufficient arguments
- too many arguments For this reason it also requires the SignalError trait.
There are 2 main scenarios for it:
- deserializing endpoint arguments directly from the API
- deserializing callback arguments saved to storage, from a call data string
Required methods
pub fn has_next(&self) -> bool
[src]
Check if there are more arguments that can be loaded.
pub fn next_arg_input(&mut self) -> I
[src]
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.
Provided methods
pub fn assert_no_more_args(&self)
[src]
Called after retrieving all arguments to validate that extra arguments were not provided.
Implementors
impl<'a, SE> DynArgInput<Vec<u8, Global>> for CallDataArgLoader<'a, SE> where
SE: SignalError,
[src]
SE: SignalError,
pub fn has_next(&self) -> bool
[src]
pub fn next_arg_input(&mut self) -> Vec<u8>
[src]
impl<A, BigInt, BigUint> DynArgInput<ArgDecodeInput<A, BigInt, BigUint>> for EndpointDynArgLoader<A, BigInt, BigUint> where
BigUint: BigUintApi + 'static,
BigInt: BigIntApi<BigUint> + 'static,
A: ContractIOApi<BigInt, BigUint> + 'static,
[src]
BigUint: BigUintApi + 'static,
BigInt: BigIntApi<BigUint> + 'static,
A: ContractIOApi<BigInt, BigUint> + 'static,