Officeyutong opened issue #5788:
I'm trying to call an exported function with signature
func (seq: list<s64>) -> s64
, but I find that I can't constructwasmtime::component::Val::List(wasmtime::component::values::List())
sincewasmtime::component::values::List
is not public.Feature
Benefit
If accepted, We can invoke functions which contains a param with type list
Implementation
Just add a
pub
prefixAlternatives
May be no alternatives available?
pchickey commented on issue #5788:
At the moment, you can construct a list
Val
by way ofwasmtime::component::types::List::new_val
https://docs.rs/wasmtime/latest/wasmtime/component/types/struct.List.html#method.new_val - does that meet your needs?I think it would be ok to make the
values
mod public, just on the grounds that if theVal
enum is public, the types in all of its variants should be as well (https://docs.rs/wasmtime/latest/wasmtime/component/enum.Val.html), but I don't know if there is something about the design of using thetypes
module to constructVal
vs the direct use of the enum that I am missing. @alexcrichton what do you think?
pchickey edited a comment on issue #5788:
At the moment, you can construct a list
Val
by way ofwasmtime::component::types::List::new_val
https://docs.rs/wasmtime/latest/wasmtime/component/types/struct.List.html#method.new_val - does that meet your needs?I think it would be ok to make the
values
mod public, just on the grounds that if theVal
enum is public, the types in all of its variants should be as well (https://docs.rs/wasmtime/latest/wasmtime/component/enum.Val.html), but I don't know if there is something about the design of using thetypes
module to constructVal
vs the direct use of the enum that I am missing. @alexcrichton what do you think?If we choose not to make those types public we should note the preferred way to construct those variants in the docs for
Val
.
alexcrichton commented on issue #5788:
The original intention was to reexport everything necessary form the
values
module into the top-levelcomponent
module, so this may be a forgotten reexport?
pchickey commented on issue #5788:
Ok! I'll add the forgotten reexports :)
pchickey closed issue #5788:
I'm trying to call an exported function with signature
func (seq: list<s64>) -> s64
, but I find that I can't constructwasmtime::component::Val::List(wasmtime::component::values::List())
sincewasmtime::component::values::List
is not public.Feature
Benefit
If accepted, We can invoke functions which contains a param with type list
Implementation
Just add a
pub
prefixAlternatives
May be no alternatives available?
Last updated: Nov 22 2024 at 16:03 UTC