bytecodealliance / bytecodealliance/wit-bindgen
[rust-macro] generate! should allow defering handling exports to dependent crates
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 286
- Avg merge
- 6h 32m
- Merged PRs (30d)
- 19
Description
See discussion here: https://bytecodealliance.zulipchat.com/#narrow/stream/327223-wit-bindgen/topic/external.20export.20implementations/near/387677837
I also want this feature. It kind of used to exist with the old export macro approach that was replaced when resource type support was added. You used to be able to have one library crate that called `generate!` and exported the "export" macro to any dependent crates who could then bind the exports of the world. When resource types were added the API changed to force the invoker of `generate!` to specify what interfaces it was exporting and implement them right then and there (at least that's my understanding).
As @alexcrichton mentioned wastime's `bindgen!` macro lets you do something like this already with more sophisticated macro parameters. Perhaps this approach could be applied here too.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.