Struct wasm_runtime_layer::ExternRef 
source · pub struct ExternRef { /* private fields */ }Expand description
Represents a nullable 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: impl Into<Option<T>>
) -> Self
 
pub fn new<T: 'static + Send + Sync, C: AsContextMut>( ctx: C, object: impl Into<Option<T>> ) -> Self
Creates a new ExternRef wrapping the given value.
sourcepub fn downcast<'a, T: 'static, S: 'a, E: WasmEngine>(
    &self,
    ctx: StoreContext<'a, S, E>
) -> Result<Option<&'a T>>
 
pub fn downcast<'a, T: 'static, S: 'a, E: WasmEngine>( &self, ctx: StoreContext<'a, S, E> ) -> Result<Option<&'a T>>
Returns a shared reference to the underlying data for this ExternRef.
Trait Implementations§
Auto Trait Implementations§
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