Skip to content

wasmtime: generalize InstanceExportLookup into ExportLookup#13500

Merged
pchickey merged 4 commits into
bytecodealliance:mainfrom
pchickey:pch/export_lookup
May 28, 2026
Merged

wasmtime: generalize InstanceExportLookup into ExportLookup#13500
pchickey merged 4 commits into
bytecodealliance:mainfrom
pchickey:pch/export_lookup

Conversation

@pchickey
Copy link
Copy Markdown
Contributor

The wasmtime::component::Instance struct had getter methods that accepted impl InstanceExportLookup, a pseudo-sealed trait (via #[doc(hidden)]) with impls for &str, String, or ComponentExportIndex.

Conversely, the wasmtime::component::Component struct had get_export and get_export_index methods which took arguments instance: Option<&ComponentExportIndex> and name: &str.

This PR renames the trait to ExportLookup, with the exact same impls, and modifies the Component::get_export[_index] methods to take impl ExportLookup instead of &str arguments.

This is motivated by a follow-up PR that will add wit_parser::ItemName as another type that impls ExportIndex.

@pchickey pchickey requested a review from alexcrichton May 27, 2026 23:28
@pchickey pchickey requested a review from a team as a code owner May 27, 2026 23:28
@pchickey pchickey force-pushed the pch/export_lookup branch from dccc9db to 2c11692 Compare May 27, 2026 23:41
because changing from &str to impl ExportLookup in argument to
Component::get_export created ambiguity
@alexcrichton alexcrichton added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@pchickey pchickey enabled auto-merge May 28, 2026 20:10
@pchickey pchickey added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@pchickey pchickey added this pull request to the merge queue May 28, 2026
@pchickey
Copy link
Copy Markdown
Contributor Author

Last merge queue failure was because a mac ci runner hung

Merged via the queue into bytecodealliance:main with commit b333e5c May 28, 2026
51 checks passed
@pchickey pchickey deleted the pch/export_lookup branch May 28, 2026 21:45
yagehu pushed a commit to yagehu/wasmtime-x that referenced this pull request Jun 1, 2026
…alliance#13500)

* wasmtime::component: rename InstanceExportLookup to ExportLookup

* Component::get_ functions can use ExportLookup as well now

* wasmtime wit bindgen, component macro: add type annotation

because changing from &str to impl ExportLookup in argument to
Component::get_export created ambiguity

* fix docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants