bytecodealliance / bytecodealliance/wasmtime
Add `sub_linker()` API
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
The [RFC 11](https://github.com/bytecodealliance/rfcs/pull/11) mentions an addition of `sub_linker `.
> Note that a new API is also provided, `sub_linker()`. This method allows creating a "child" linker which inherits all of the previous values set by the parent but also allows defining new values in the returned value for instantiation.
It was not added yet, but it would be nice to have for my use case. I define a lot of host functions in the `Linker`, but then for each `Store` [add a different module as an import](https://docs.rs/wasmtime/0.28.0/wasmtime/struct.Linker.html#method.module). This immediately "poisons" the Linker with a particular `Store` and I need to re-add all the host functions again to a new `Linker` for other `Store`s.
Maybe, just having `Clone` on the `Linker` would be enough here.
Contributor guide
Assessment
This issue has not been assessed yet.