Trait InterpretableProgram

Source
pub trait InterpretableProgram {
    // Required methods
    fn load_data_into_memory(
        &self,
        mem: &mut Vec<u8>,
    ) -> Result<(), &'static str>;
    fn initial_memory_size(&self) -> usize;
    fn import_fn_details(
        &self,
        index: usize,
    ) -> Result<(&str, &str, usize), &'static str>;
    fn import_fn_count(&self) -> usize;
    fn fetch_export_fn_index(
        &self,
        name: &str,
    ) -> Result<(usize, usize), &'static str>;
    fn fetch_instruction<'a>(
        &'a self,
        position: &[usize],
    ) -> Result<Option<&'a Instruction>, &'static str>;
    fn create_locals(
        &self,
        position: &[usize],
    ) -> Result<Vec<WasmValue>, &'static str>;
}

Required Methods§

Source

fn load_data_into_memory(&self, mem: &mut Vec<u8>) -> Result<(), &'static str>

Source

fn initial_memory_size(&self) -> usize

Source

fn import_fn_details( &self, index: usize, ) -> Result<(&str, &str, usize), &'static str>

Source

fn import_fn_count(&self) -> usize

Source

fn fetch_export_fn_index( &self, name: &str, ) -> Result<(usize, usize), &'static str>

Source

fn fetch_instruction<'a>( &'a self, position: &[usize], ) -> Result<Option<&'a Instruction>, &'static str>

Source

fn create_locals( &self, position: &[usize], ) -> Result<Vec<WasmValue>, &'static str>

Implementors§