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§
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>
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.