When used with a component, wasmtime.bindgen will generate something like this:
import wasmtime
class Root:
def __init__(self, store: wasmtime.Store) -> None:
...
def render_json(self, caller: wasmtime.Store, json: str) -> str:
...
At first I thought that caller != store is a valid configuration but it's clearly not since it aborts:
thread '<unnamed>' panicked at crates/wasmtime/src/runtime/func.rs:875:9:
assertion failed: self.comes_from_same_store(store)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted
Why not capture the store then? It's annoying to have to thread it down into every call if there's only one valid value for it anyway.