pub trait InstanceState {
// Required methods
fn global_get(
&mut self,
name: &str,
) -> impl Future<Output = SnapshotVal> + Send;
fn memory_contents(
&mut self,
name: &str,
contents: impl FnOnce(&[u8]) + Send,
) -> impl Future<Output = ()> + Send;
}Expand description
Abstract ability to load state from a WebAssembly instance after it’s been instantiated and some exports have run.
Required Methods§
Sourcefn global_get(&mut self, name: &str) -> impl Future<Output = SnapshotVal> + Send
fn global_get(&mut self, name: &str) -> impl Future<Output = SnapshotVal> + Send
Loads the global specified by name, returning a SnapshotVal.
§Panics
This function panics if name isn’t an exported global or if the type
of the global doesn’t fit in SnapshotVal.
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§
impl<T: Send> InstanceState for WasmtimeWizer<'_, T>
Available on crate feature
wasmtime only.