pub struct WasmStoreRef { /* private fields */ }
Expand description
This representation of a Store
is used to implement the wasm.h
API (and
not the wasmi.h
API!)
This is stored alongside Func
and such for wasm.h
so each object is
independently owned. The usage of Arc
here is mostly to just get it to be
safe to drop across multiple threads, but otherwise acquiring the context
values from this struct is considered unsafe due to it being unknown how the
aliasing is working on the C side of things.
The aliasing requirements are documented in the C API wasm.h
itself (at
least Wasmi’s implementation).
Implementations§
Source§impl WasmStoreRef
impl WasmStoreRef
Sourcepub unsafe fn context(&self) -> StoreContext<'_, ()>
pub unsafe fn context(&self) -> StoreContext<'_, ()>
Returns shared access to the store context of the WasmStoreRef
.
Wraps wasmi::AsContext
.
§Safety
It is the callers responsibility to provide a valid self
.
Sourcepub unsafe fn context_mut(&mut self) -> StoreContextMut<'_, ()>
pub unsafe fn context_mut(&mut self) -> StoreContextMut<'_, ()>
Returns mutable access to the store context of the WasmStoreRef
.
Wraps wasmi::AsContextMut
.
§Safety
It is the callers responsibility to provide a valid self
.
Trait Implementations§
Source§impl Clone for WasmStoreRef
impl Clone for WasmStoreRef
Source§fn clone(&self) -> WasmStoreRef
fn clone(&self) -> WasmStoreRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more