(
&self,
mut store: impl AsContextMut<Data = T>,
)
| 931 | /// details on Wasmtime's out-of-memory handling. |
| 932 | #[cfg(feature = "async")] |
| 933 | pub async fn instantiate_async( |
| 934 | &self, |
| 935 | mut store: impl AsContextMut<Data = T>, |
| 936 | ) -> Result<Instance> { |
| 937 | let mut store = store.as_context_mut(); |
| 938 | let imports = pre_instantiate_raw( |
| 939 | &mut store.0, |
| 940 | &self.module, |
| 941 | &self.items, |
| 942 | self.host_funcs, |
| 943 | &self.func_refs, |
| 944 | self.asyncness, |
| 945 | )?; |
| 946 | |
| 947 | // This unsafety should be handled by the type-checking performed by the |
| 948 | // constructor of `InstancePre` to assert that all the imports we're passing |
| 949 | // in match the module we're instantiating. |
| 950 | unsafe { |
| 951 | Instance::new_started(&mut store, &self.module, imports.as_ref(), Asyncness::Yes).await |
| 952 | } |
| 953 | } |
| 954 | } |
| 955 | |
| 956 | /// Helper function shared between |
nothing calls this directly
no test coverage detected