Implement nested instance exports for components (#4364)

This commit adds support to Wasmtime for components which themselves
export instances. The support here adds new APIs for how instance
exports are accessed in the embedding API. For now this is mostly just a
first-pass where the API is somewhat confusing and has a lot of
lifetimes. I'm hoping that over time we can figure out how to simplify
this but for now it should at least be expressive enough for exploring
the exports of an instance.
This commit is contained in:
Alex Crichton
2022-07-05 11:04:54 -05:00
committed by GitHub
parent 2003ae99a0
commit 76a2545a7f
10 changed files with 431 additions and 146 deletions

View File

@@ -193,7 +193,7 @@ impl<T> WastContext<T> {
// function from one instance and put it into the linker
// (must go through the host right now).
let mut linker = self.component_linker.instance(name.name())?;
for (name, module) in instance.modules(&self.store) {
for (name, module) in instance.exports(&mut self.store).root().modules() {
linker.module(name, module)?;
}
}