Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set wasmtime::component::values to be public #5788

Closed
Officeyutong opened this issue Feb 15, 2023 · 3 comments · Fixed by #5790
Closed

Set wasmtime::component::values to be public #5788

Officeyutong opened this issue Feb 15, 2023 · 3 comments · Fixed by #5790

Comments

@Officeyutong
Copy link

I'm trying to call an exported function with signature func (seq: list<s64>) -> s64, but I find that I can't construct wasmtime::component::Val::List(wasmtime::component::values::List()) since wasmtime::component::values::List is not public.

Feature

Add pub to

Benefit

If accepted, We can invoke functions which contains a param with type list

Implementation

Just add a pub prefix

Alternatives

May be no alternatives available?

@pchickey
Copy link
Contributor

pchickey commented Feb 15, 2023

At the moment, you can construct a list Val by way of wasmtime::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 the Val 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 the types module to construct Val 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
Copy link
Member

The original intention was to reexport everything necessary form the values module into the top-level component module, so this may be a forgotten reexport?

@pchickey
Copy link
Contributor

Ok! I'll add the forgotten reexports :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants