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§

source

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

source

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.

source

fn read_vec( &self, store: &mut <Store as Store>::ActualStore<'_>, offset: u32, size: u32 ) -> Vec<u8>

This function will panic if [offset..offset + size] is out of bounds. It is caller’s responsibility to check if the offset is in bounds using MemoryView::check_bounds function.

Implementors§