Commit 614c2ed
feat(wasm-encoder): add
The core-level analogue `core_instantiate_exports` already exists on
`ComponentBuilder` and mirrors the `Instance::FromExports` variant of
the core instance section. The component-level side had no equivalent:
`ComponentInstanceSection::export_items` is public but only reachable
through the manual section-append path, not the builder facade.
Add `instantiate_exports` next to `instantiate` so callers rebuilding
a component structurally from a parsed one can round-trip
`ComponentInstance::FromExports` the same way core-level
`Instance::FromExports` already round-trips.
The signature follows the section-level `ComponentInstanceSection::
export_items` — `N: Into<ComponentExternName<'a>>` in the name slot,
preserving the rich name form (`implements` / `version_suffix` /
`external_id`) an item can carry. `&'a str` satisfies the bound via
the existing `From<&'a str> for ComponentExternName<'a>`, so callers
that only need a plain name write the same call as with
`core_instantiate_exports`.
Co-authored-by: Zachary Whitley <zachary.whitley@tegmentum.ai>ComponentBuilder::instantiate_exports (#2655)1 parent e248d28 commit 614c2ed
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
485 | 498 | | |
486 | 499 | | |
487 | 500 | | |
| |||
0 commit comments