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.
Implementations
impl Instance
fn new(module: &Module, imports: &Object) -> Result<Instance, JsValue>The
WebAssembly.Instance()constructor function can be called to synchronously instantiate a givenWebAssembly.Moduleobject. However, the primary way to get anInstanceis through the asynchronousWebAssembly.instantiateStreaming()function.
impl Instance
fn exports(&self) -> ObjectThe
exportsreadonly property of theWebAssembly.Instanceobject 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.
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) -> boolfn unchecked_from_js(val: JsValue) -> Selffn 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()