pub struct EvmDataReader<'a> { /* private fields */ }Expand description
Wrapper around an EVM input slice, helping to parse it. Provide functions to parse common types.
Implementations§
Source§impl<'a> EvmDataReader<'a>
impl<'a> EvmDataReader<'a>
Sourcepub fn expect_arguments(&self, args: usize) -> EvmResult
pub fn expect_arguments(&self, args: usize) -> EvmResult
Check the input has at least the correct amount of arguments before the end (32 bytes values).
Sourcepub fn read_raw_bytes(&mut self, len: usize) -> EvmResult<&[u8]>
pub fn read_raw_bytes(&mut self, len: usize) -> EvmResult<&[u8]>
Read raw bytes from the input.
Doesn’t handle any alignement checks, prefer using read instead of possible.
Returns an error if trying to parse out of bounds.
Sourcepub fn read_selector<T>(&mut self) -> EvmResult<T>where
T: TryFromPrimitive<Primitive = u32>,
pub fn read_selector<T>(&mut self) -> EvmResult<T>where
T: TryFromPrimitive<Primitive = u32>,
Parse (4 bytes) selector. Returns an error if trying to parse out of bounds.
Trait Implementations§
Source§impl<'a> Clone for EvmDataReader<'a>
impl<'a> Clone for EvmDataReader<'a>
Source§fn clone(&self) -> EvmDataReader<'a>
fn clone(&self) -> EvmDataReader<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for EvmDataReader<'a>
impl<'a> Debug for EvmDataReader<'a>
impl<'a> Copy for EvmDataReader<'a>
Auto Trait Implementations§
impl<'a> Freeze for EvmDataReader<'a>
impl<'a> RefUnwindSafe for EvmDataReader<'a>
impl<'a> Send for EvmDataReader<'a>
impl<'a> Sync for EvmDataReader<'a>
impl<'a> Unpin for EvmDataReader<'a>
impl<'a> UnwindSafe for EvmDataReader<'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