MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / instantiate

Method instantiate

crates/wasmtime/src/runtime/component/instance.rs:1136–1146  ·  view source on GitHub ↗

Performs the instantiation process into the store specified. # Errors This function will return an [`OutOfMemory`][crate::OutOfMemory] error when memory allocation fails. See the `OutOfMemory` type's documentation for details on Wasmtime's out-of-memory handling. TODO: needs more docs

(&self, mut store: impl AsContextMut<Data = T>)

Source from the content-addressed store, hash-verified

1134 //
1135 // TODO: needs more docs
1136 pub fn instantiate(&self, mut store: impl AsContextMut<Data = T>) -> Result<Instance> {
1137 let store = store.as_context_mut();
1138
1139 // If this instance requires an async host, set that flag in the store,
1140 // and then afterwards assert nothing else in the store, nor this
1141 // instance, required async.
1142 store.0.set_async_required(self.asyncness);
1143 store.0.validate_sync_call()?;
1144
1145 vm::assert_ready(self._instantiate(store, Asyncness::No))
1146 }
1147 /// Performs the instantiation process into the store specified.
1148 ///
1149 /// Exactly like [`Self::instantiate`] except for use on async stores.

Callers

nothing calls this directly

Calls 5

validate_sync_callMethod · 0.80
_instantiateMethod · 0.80
assert_readyFunction · 0.50
as_context_mutMethod · 0.45
set_async_requiredMethod · 0.45

Tested by

no test coverage detected