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

Allow users to provide custom host functions to WasiRunner and WasiEnvBuilder #4403

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

Michael-F-Bryan
Copy link
Contributor

This PR updates WasiEnvBuilder and WasiRunner to allow providing custom imports that will be used when instantiating a WASIX module.

I've also re-worked the WasiRunner's builder methods to all follow the fn with_xxx(&mut self, ...) -> &mut Self pattern. The Runner trait's run_command() method already takes &mut self, so that means people can do WasiRunner::new().with_args(...).run_command(...) without needing to introduce an intermediate variable. This should be more ergonomic than forcing people to builder methods that either consume or setters that don't allow chaining.

@Michael-F-Bryan Michael-F-Bryan marked this pull request as ready for review January 16, 2024 09:09
@Michael-F-Bryan Michael-F-Bryan force-pushed the wasi-runner-custom-imports branch from 0426d8f to 5727d53 Compare January 16, 2024 10:35
@Michael-F-Bryan Michael-F-Bryan merged commit fc7c89f into master Jan 16, 2024
51 of 52 checks passed
@Michael-F-Bryan Michael-F-Bryan deleted the wasi-runner-custom-imports branch January 16, 2024 11:26
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 this pull request may close these issues.

2 participants