Trait it_memory_traits::MemoryReadable
source · pub trait MemoryReadable<Store: Store> {
// Required methods
fn read_byte(
&self,
store: &mut <Store as Store>::ActualStore<'_>,
offset: u32
) -> u8;
fn read_array<const COUNT: usize>(
&self,
store: &mut <Store as Store>::ActualStore<'_>,
offset: u32
) -> [u8; COUNT];
fn read_vec(
&self,
store: &mut <Store as Store>::ActualStore<'_>,
offset: u32,
size: u32
) -> Vec<u8>;
}
Required Methods§
sourcefn read_byte(
&self,
store: &mut <Store as Store>::ActualStore<'_>,
offset: u32
) -> u8
fn read_byte( &self, store: &mut <Store as Store>::ActualStore<'_>, offset: u32 ) -> u8
This function will panic if the offset
is out of bounds.
It is caller’s responsibility to check if the offset is in bounds
using MemoryView::check_bounds
function
sourcefn read_array<const COUNT: usize>(
&self,
store: &mut <Store as Store>::ActualStore<'_>,
offset: u32
) -> [u8; COUNT]
fn read_array<const COUNT: usize>( &self, store: &mut <Store as Store>::ActualStore<'_>, offset: u32 ) -> [u8; COUNT]
This function will panic if [offset..offset + COUNT]
is out of bounds.
It is caller’s responsibility to check if the offset is in bounds
using MemoryView::check_bounds
function.