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

Method new

crates/component-macro/tests/expanded/function-new_async.rs:27–32  ·  view source on GitHub ↗

Creates a new copy of `FooPre` bindings which can then be used to instantiate into a particular store. This method may fail if the component behind `instance_pre` does not have the required exports.

(
        instance_pre: wasmtime::component::InstancePre<_T>,
    )

Source from the content-addressed store, hash-verified

25 /// This method may fail if the component behind `instance_pre`
26 /// does not have the required exports.
27 pub fn new(
28 instance_pre: wasmtime::component::InstancePre<_T>,
29 ) -> wasmtime::Result<Self> {
30 let indices = FooIndices::new(&instance_pre)?;
31 Ok(Self { instance_pre, indices })
32 }
33 pub fn engine(&self) -> &wasmtime::Engine {
34 self.instance_pre.engine()
35 }

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
newFunction · 0.50
componentMethod · 0.45
instance_typeMethod · 0.45
get_exportMethod · 0.45
instance_preMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected