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

@@ -393,6 +393,9 @@ pub enum Export {
/// The module index here indexes a module recorded with
/// `GlobalInitializer::SaveModule` above.
Module(RuntimeModuleIndex),
/// A nested instance is being exported which has recursively defined
/// `Export` items.
Instance(IndexMap<String, Export>),
}
/// Canonical ABI options associated with a lifted or lowered function.