| 511638f5 | 10-Mar-2026 |
Alex Crichton <[email protected]> |
Refactor `wasi:http` headers' host representation (#12754)
* Refactor `wasi:http` headers' host representation
This commit is a follow-on/extension of #12748 and extends the changes made for WASIp2
Refactor `wasi:http` headers' host representation (#12754)
* Refactor `wasi:http` headers' host representation
This commit is a follow-on/extension of #12748 and extends the changes made for WASIp2 headers in #12652 to the WASIp3 implementation as well. This is done through a number of refactorings to make the WASIp2 and WASIp3 implementations more similar in terms of how they represent headers. Changes here are:
* `FieldMap` now has its own dedicated module at the crate root instead of intermingling with other WASIp2 types. * `FieldMap` is now internally-`Arc`'d and is cheaply clonable. `FieldMap` itself now tracks whether it's mutable or immutable (WASI semantics) and doesn't need different wrappers in WASIp2 and WASIp3. * Creation of an immutable `FieldMap` can be done without needing a size limit. Flagging a `FieldMap` as mutable, however, requires a size limit. * `FieldMap::set` was added to be a bit more efficient w.r.t. clones. * `FieldMapError` is a new error type that covers all of the possible error modes of operating with a `FieldMap`. Conversions from this to WASIp{2,3} `header-error` types are now implemented as well. * WASIp2 now flags `header-error` as a trappable-error-type, allowing the use of `?` in implementing header functions (like WASIp3). * Much of WASIp2's header implementation was refactored with `?`, moving methods around, shuffling where headers are made vs `FieldMap`, some minor idioms, etc. * WASIp3 no longer uses `MaybeMutable` for headers and instead uses `FieldMap` directly.
cc #12674
* Clippy warnings
show more ...
|
| 8c03849b | 27-Oct-2025 |
Dan Gohman <[email protected]> |
Use `.` instead of `/` for interface members. (#11947)
* Use `.` instead of `/` for interface members.
In the `wasmtime::component::generate` macro, change the syntax for referencing functions and
Use `.` instead of `/` for interface members. (#11947)
* Use `.` instead of `/` for interface members.
In the `wasmtime::component::generate` macro, change the syntax for referencing functions and types inside interfaces to use `.` instead of `/`.
For example, this changes strings like `wasi:http/types/outgoing-body` to `wasi:http/types.outgoing-body` .
This makes the syntax more consistent with the syntax of [WIT `use` statements], which use `.` for this purpose.
And, it avoids an incompatibility with the future nested namespaces syntax ([]), where the `/d` in `a:b/c/d` is for traversing a component export rather than an interface member.
[WIT `use` statements]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-packages-and-use []: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#gated-features
* Use the new syntax in more places.
* Revert changes to vendored WIT files.
* Revert more changes to vendored files.
* Update syntax in more places.
show more ...
|