pub struct AbiReader<'i> { /* private fields */ }
Expand description
View into RLP data, which provides method to read typed items from it
Implementations§
source§impl<'i> AbiReader<'i>
impl<'i> AbiReader<'i>
sourcepub fn new_call(buf: &'i [u8]) -> Result<(Bytes4, Self)>
pub fn new_call(buf: &'i [u8]) -> Result<(Bytes4, Self)>
Start reading RLP buffer, parsing first 4 bytes as selector
Errors
Fails if provided buffer has not enough length for selector+data
sourcepub fn read_usize(&mut self) -> Result<usize>
👎Deprecated: dangerous, as usize may have different width in wasm and native execution
pub fn read_usize(&mut self) -> Result<usize>
Read usize
at current position, then advance
sourcepub fn bytes_read(&mut self, size: usize)
pub fn bytes_read(&mut self, size: usize)
Notify about readed data portion.
sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Is this parser reached end of buffer?
Trait Implementations§
Auto Trait Implementations§
impl<'i> RefUnwindSafe for AbiReader<'i>
impl<'i> Send for AbiReader<'i>
impl<'i> Sync for AbiReader<'i>
impl<'i> Unpin for AbiReader<'i>
impl<'i> UnwindSafe for AbiReader<'i>
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