pub trait MemoryContext {
// Required methods
fn get_memory(&self) -> &Memory;
fn get_alloc(&self) -> &NativeFunc<u32, WasmPtr<u8, Array>>;
// Provided methods
fn write_bytes_to_memory(
&self,
value: Vec<u8>,
val_ptr_ptr: u32,
) -> Result<u32> { ... }
fn read_bytes_from_memory(&self, offset: u32, len: u32) -> Result<Vec<u8>> { ... }
}
Expand description
Memory context is used by Wasmer Environment for read-write access to WASM linear memory.