Stream: general

Topic: ✔ wasmtime::component::ResourceTable usage


view this post on Zulip Joe Sylve (Aug 22 2024 at 16:18):

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?

view this post on Zulip Joe Sylve (Aug 22 2024 at 16:26):

Ah, I just noticed the with option in bindgen that will allow me to specify my concrete type for the resource. That'll work.

view this post on Zulip Notification Bot (Aug 22 2024 at 16:26):

Joe Sylve has marked this topic as resolved.


Last updated: Nov 22 2024 at 16:03 UTC