Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation and refactor
wasmtime-wasi
(#8228)
* Add documentation and examples for `wasmtime-wasi` This commit adds lots of missing documentation and examples to top-level types in `wasmtime-wasi`, mostly related to WASIp2. I've additionally made a number of small refactorings here to try to make the APIs a bit more straightforward and symmetric and simplify where I can. * Remove `bindings::wasi` (reexports are still present under `bindings`) * Rename `bindings::sync_io` to `bindings::sync` * Generate fewer bindings in `bindings::sync` that can be pulled in from the `bindings` module. * Change `WasiCtxBuilder::preopened_dir` to take a path instead of a `Dir` argument to avoid the need for another import. * Synchronize `wasmtime_wasi_http::{add_to_linker, sync::add_to_linker}` in terms of interfaces added. * Remove `wasmtime_wasi::command` and move the generated types to the `bindings` module. * Move top-level add-to-linker functions to `wasmtime_wasi::add_to_linker_sync` and `wasmtime_wasi::add_to_linker_async`. Closes #8187 Closes #8188 * Add documentation for `wasmtime_wasi::preview1` and refactor This commit adds documentation for the `wasmtime_wasi::preview1` module and additionally refactors it as well. Previously this was based on a similar design as WASIp2 with a "view trait" and various bits and pieces, but the design constraints of WASIp1 lends itself to a simpler solution of "just" passing around `WasiP1Ctx` instead. This goes back to what `wasi-common` did of sorts where the `add_to_linker_*` functions only need a projection from `&mut T` to `&mut WasiP1Ctx`, a concrete type, which simplifies the module and usage. * Small refactorings to `preopened_dir` * Add `WasiCtx::builder`. * Fix typo * Review comments
- Loading branch information