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 moreAuto Trait Implementations§
impl Freeze for WasmStoreRef
impl !RefUnwindSafe for WasmStoreRef
impl !Send for WasmStoreRef
impl !Sync for WasmStoreRef
impl Unpin for WasmStoreRef
impl !UnwindSafe for WasmStoreRef
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.