Trait CustomContextVM

Source
pub trait CustomContextVM {
    // Required methods
    fn read(&self, mem_pos: usize, buf: &mut [u8]);
    fn data(&self) -> &[u8] ;
    fn write(&mut self, pos: u32, slice: &[u8]) -> i64;
    fn data_mut(&mut self) -> &mut [u8] ;
}
Expand description

A trait that VMs that want to work with a custom context should implement.

Required Methods§

Source

fn read(&self, mem_pos: usize, buf: &mut [u8])

Return WASMI’s Memory handle.

Source

fn data(&self) -> &[u8]

Source

fn write(&mut self, pos: u32, slice: &[u8]) -> i64

Source

fn data_mut(&mut self) -> &mut [u8]

Implementors§