When a host is creating a new Resource, is it expected that the resource itself should be stored in the ResourceTable or is the ResourceTable only intended as a marker storage for the IDs?
The reason my question comes up is that wasmtime::component::bindgen
seems to be generating empty enums for my host's resource types. Using push<MyResource>
on the table would get a Resource<MyResource>
that only stores that zero sized enum. I'm then left with manging a seperate table of resources to store the actual implementation.
Assuming the resource actually needs a state, should I not be letting bindgen generate the resource type for me or am I overlooking something?
Ah, I just noticed the with
option in bindgen that will allow me to specify my concrete type for the resource. That'll work.
Joe Sylve has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC