Memory

Trait Memory 

Source
pub trait Memory: Sized + Clone {
    // Required methods
    fn new(initial: u32, maximum: Option<u32>) -> Result<Self>;
    fn get(&self, ptr: u32, buf: &mut [u8]) -> Result<()>;
    fn set(&self, ptr: u32, value: &[u8]) -> Result<()>;
}
Expand description

Inkpad wasm executor memory

Required Methods§

Source

fn new(initial: u32, maximum: Option<u32>) -> Result<Self>

Construct a new linear memory instance

Source

fn get(&self, ptr: u32, buf: &mut [u8]) -> Result<()>

Read a memory area at the address ptr with the size of the provided slice buf.

Source

fn set(&self, ptr: u32, value: &[u8]) -> Result<()>

Write a memory area at the address ptr with contents of the provided slice buf.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§