pub struct HexCallDataDeserializer<'a> { /* private fields */ }
Expand description
Deserializes from the MultiversX 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 TopDecodeMultiInput for HexCallDataDeserializer<'_>
impl TopDecodeMultiInput for HexCallDataDeserializer<'_>
type ValueInput = Box<[u8]>
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.fn 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.
Auto Trait Implementations§
impl<'a> Freeze for HexCallDataDeserializer<'a>
impl<'a> RefUnwindSafe for HexCallDataDeserializer<'a>
impl<'a> Send for HexCallDataDeserializer<'a>
impl<'a> Sync for HexCallDataDeserializer<'a>
impl<'a> Unpin for HexCallDataDeserializer<'a>
impl<'a> UnwindSafe for HexCallDataDeserializer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more