Struct wasm_runtime_layer::ExternRef
source · pub struct ExternRef { /* private fields */ }
Expand description
Represents an opaque reference to any data within WebAssembly.
Implementations§
source§impl ExternRef
impl ExternRef
sourcepub fn new<T: 'static + Send + Sync, C: AsContextMut>(ctx: C, object: T) -> Self
pub fn new<T: 'static + Send + Sync, C: AsContextMut>(ctx: C, object: T) -> Self
Creates a new ExternRef
wrapping the given value.
sourcepub fn downcast<'a, 's: 'a, T: 'static, S: 's, E: WasmEngine>(
&'a self,
ctx: StoreContext<'s, S, E>
) -> Result<&'a T>
pub fn downcast<'a, 's: 'a, T: 'static, S: 's, E: WasmEngine>( &'a self, ctx: StoreContext<'s, S, E> ) -> Result<&'a T>
Returns a shared reference to the underlying data for this ExternRef
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExternRef
impl !RefUnwindSafe for ExternRef
impl Send for ExternRef
impl Sync for ExternRef
impl Unpin for ExternRef
impl !UnwindSafe for ExternRef
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
Mutably borrows from an owned value. Read more