Trait InternalExt

Source
pub trait InternalExt {
Show 20 methods // Required methods fn store(&self) -> &Store<Internal>; fn store_mut(&mut self) -> &mut Store<Internal>; fn linker(&self) -> &Linker<Internal>; fn linker_mut(&mut self) -> &mut Linker<Internal>; fn linker_and_store( &mut self, ) -> (&mut Linker<Internal>, &mut Store<Internal>); // Provided methods fn internal(&self) -> &Internal { ... } fn internal_mut(&mut self) -> &mut Internal { ... } fn memory_ptr(&mut self) -> *mut u8 { ... } fn memory(&mut self) -> &mut [u8] { ... } fn memory_read(&mut self, offs: u64, len: Size) -> &[u8] { ... } fn memory_read_str(&mut self, offs: u64) -> Result<&str, Utf8Error> { ... } fn memory_write(&mut self, offs: u64, bytes: impl AsRef<[u8]>) { ... } fn memory_alloc(&mut self, n: Size) -> Result<u64, Error> { ... } fn memory_alloc_bytes( &mut self, bytes: impl AsRef<[u8]>, ) -> Result<u64, Error> { ... } fn memory_free(&mut self, offs: u64) { ... } fn memory_length(&mut self, offs: u64) -> u64 { ... } fn error<E>(&mut self, e: impl Debug, x: E) -> E { ... } fn clear_error(&mut self) { ... } fn has_error(&mut self) -> bool { ... } fn get_error(&mut self) -> Option<&str> { ... }
}
Expand description

InternalExt provides a unified way of acessing memory, store and internal values

Required Methods§

Source

fn store(&self) -> &Store<Internal>

Source

fn store_mut(&mut self) -> &mut Store<Internal>

Source

fn linker(&self) -> &Linker<Internal>

Source

fn linker_mut(&mut self) -> &mut Linker<Internal>

Source

fn linker_and_store(&mut self) -> (&mut Linker<Internal>, &mut Store<Internal>)

Provided Methods§

Source

fn internal(&self) -> &Internal

Source

fn internal_mut(&mut self) -> &mut Internal

Source

fn memory_ptr(&mut self) -> *mut u8

Source

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

Source

fn memory_read(&mut self, offs: u64, len: Size) -> &[u8]

Source

fn memory_read_str(&mut self, offs: u64) -> Result<&str, Utf8Error>

Source

fn memory_write(&mut self, offs: u64, bytes: impl AsRef<[u8]>)

Source

fn memory_alloc(&mut self, n: Size) -> Result<u64, Error>

Source

fn memory_alloc_bytes(&mut self, bytes: impl AsRef<[u8]>) -> Result<u64, Error>

Source

fn memory_free(&mut self, offs: u64)

Source

fn memory_length(&mut self, offs: u64) -> u64

Source

fn error<E>(&mut self, e: impl Debug, x: E) -> E

Source

fn clear_error(&mut self)

Source

fn has_error(&mut self) -> bool

Source

fn get_error(&mut self) -> Option<&str>

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§