pub struct HexCallDataDeserializer<'a> { /* private fields */ }Expand description
Deserializes from Dharitri’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. Use the serializer module for that.
Implementations§
source§impl<'a> HexCallDataDeserializer<'a>
impl<'a> HexCallDataDeserializer<'a>
pub fn new(source: &'a [u8]) -> Self
sourcepub fn get_func_name(&self) -> &'a [u8]
pub fn get_func_name(&self) -> &'a [u8]
Gets the first component of the call data, which is the function name. Unlike the arguments, this can be called at any time.
pub fn has_next(&self) -> bool
sourcepub fn next_argument(&mut self) -> Result<Option<Vec<u8>>, StaticSCError>
pub fn next_argument(&mut self) -> Result<Option<Vec<u8>>, StaticSCError>
Gets the next argument, deserializes from hex and returns the resulting bytes.
Auto Trait Implementations§
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