Is it accurate to say that wasmtime-wit-bindgen
currently only supports host-implemented resources (i.e. the host exporting resources to the guest)? If so, is it possible to import resources from the guest by using wasmtime::component::resources
directly (i.e. without binding generation), and are there any examples of doing that?
I'm working on implementing resource support in componentize-py
and would like to test both directions.
Correct yeah, although supporting guest-defined resources shouldn't be too much of a leap from where it is already
For the time being, it looks like I can call the guest resource's constructor like it's a regular exported function and then expect a wasmtime::component::values::Val::Resource
to be returned. Is that currently the best/only option?
oh, I see now that ResourceAny
implements ComponentType
, so I can use the typed_func
API
ah yeah all guest resources will be represented with ResourceAny
Last updated: Dec 23 2024 at 14:03 UTC