Struct Instance

#[repr(transparent)]
pub struct Instance { /* private fields */ }

A WebAssembly.Instance object is a stateful, executable instance of a WebAssembly.Module. Instance objects contain all the exported WebAssembly functions that allow calling into WebAssembly code from JavaScript.

MDN documentation

Implementations

impl Instance

fn new(module: &Module, imports: &Object) -> Result<Instance, JsValue>

The WebAssembly.Instance() constructor function can be called to synchronously instantiate a given WebAssembly.Module object. However, the primary way to get an Instance is through the asynchronous WebAssembly.instantiateStreaming() function.

MDN documentation

impl Instance

fn exports(&self) -> Object

The exports readonly property of the WebAssembly.Instance object prototype returns an object containing as its members all the functions exported from the WebAssembly module instance, to allow them to be accessed and used by JavaScript.

MDN documentation

Trait Implementations

impl AsRef<Instance> for Instance

fn as_ref(&self) -> &Instance

impl AsRef<JsValue> for Instance

fn as_ref(&self) -> &JsValue

impl AsRef<Object> for Instance

fn as_ref(&self) -> &Object

impl Clone for Instance

fn clone(&self) -> Self

impl Debug for Instance

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Deref for Instance

type Target = Object;
fn deref(&self) -> &Object

impl Eq for Instance

impl ErasableGeneric for Instance

type Repr = JsValue;

impl From<JsValue> for Instance

fn from(obj: JsValue) -> Self

impl FromWasmAbi for Instance

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for Instance where Instance: JsGeneric,

type JsCanon = Instance;
fn to_js(self) -> Instance

impl IntoWasmAbi for Instance

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for Instance

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for Instance

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = Instance;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for Instance

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for Instance

fn none() -> Self::Abi

impl PartialEq for Instance

fn eq(&self, other: &Self) -> bool

impl Promising for Instance

type Resolution = Instance;

impl RefFromWasmAbi for Instance

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<Instance>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl StructuralPartialEq for Instance

impl UpcastFrom<Instance> for Instance

impl WasmDescribe for Instance

fn describe()

Auto Trait Implementations

impl Freeze for Instance

impl RefUnwindSafe for Instance

impl Send for Instance

impl Sync for Instance

impl Unpin for Instance

impl UnsafeUnpin for Instance

impl UnwindSafe for Instance

Blanket Implementations

impl<P, T> Receiver for Instance where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Instance where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for Instance where T: 'static + ?Sized,

impl<T> Borrow<T> for Instance where T: ?Sized,

impl<T> BorrowMut<T> for Instance where T: ?Sized,

impl<T> CloneToUninit for Instance where T: Clone,

impl<T> From<T> for Instance

impl<T> JsGeneric for Instance where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Instance where T: IntoWasmAbi,

impl<T> ToOwned for Instance where T: Clone,

impl<T> TryFromJsValue for Instance where T: JsCast,

impl<T> VectorFromWasmAbi for Instance where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Instance where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Instance where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for Instance where U: From<T>,

impl<T, U> TryFrom<U> for Instance where U: Into<T>,

impl<T, U> TryInto<U> for Instance where U: TryFrom<T>,