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,
)
| 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 |
no test coverage detected