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

Method load

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

Uses the indices stored in `self` to load an instance of [`Foo`] from the instance provided. Note that at this time this method will additionally perform type-checks of all exports.

(
            &self,
            mut store: impl wasmtime::AsContextMut,
            instance: &wasmtime::component::Instance,
        )

Source from the content-addressed store, hash-verified

137 /// Note that at this time this method will additionally
138 /// perform type-checks of all exports.
139 pub fn load(
140 &self,
141 mut store: impl wasmtime::AsContextMut,
142 instance: &wasmtime::component::Instance,
143 ) -> wasmtime::Result<Foo> {
144 let _ = &mut store;
145 let _instance = instance;
146 let new = *_instance.get_typed_func::<(), ()>(&mut store, &self.new)?.func();
147 Ok(Foo { new })
148 }
149 }
150 impl Foo {
151 /// Convenience wrapper around [`FooPre::new`] and

Callers 3

instantiateMethod · 0.45
instantiate_asyncMethod · 0.45
newMethod · 0.45

Calls 2

OkFunction · 0.85
funcMethod · 0.45

Tested by

no test coverage detected