alexcrichton opened PR #11250 from alexcrichton:more-accessor-apis to bytecodealliance:main:
This is a follow-up to #11238 which adds
&Accessorarguments to all functions for futures and streams. Like #11238 this is done to make future refactorings easier for the internal implementation but the internal implementations are not updated at this time. Many functions, for example, do not use the argument at all just yet. The purpose of this is to ensure host usage of these functions always provides a store context.This change required large refactorings of the upcoming wasmtime-wasi-http implementation in the wasip3-prototyping repository. That's all been sorted out now though so the changes are being pulled back here into the Wasmtime repository as well.
This commit additionally changes the
watch_*functions on the various stream/future types to take&mut selfinstead ofself-by-value. This is mostly a stylistic change and is more API-driven than anything else. Functionally this behaves the same as before where, while watching, the stream/future cannot be read/written to otherwise.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #11250.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11250.
alexcrichton edited PR #11250:
This is a follow-up to #11238 which adds
&Accessorarguments to all functions for futures and streams. Like #11238 this is done to make future refactorings easier for the internal implementation but the internal implementations are not updated at this time. Many functions, for example, do not use the argument at all just yet. The purpose of this is to ensure host usage of these functions always provides a store context.This change required large refactorings of the upcoming wasmtime-wasi-http implementation in the wasip3-prototyping repository. That's all been sorted out now though so the changes are being pulled back here into the Wasmtime repository as well.
This commit additionally changes the
watch_*functions on the various stream/future types to take&mut selfinstead ofself-by-value. This is mostly a stylistic change and is more API-driven than anything else. Functionally this behaves the same as before where, while watching, the stream/future cannot be read/written to otherwise.cc https://github.com/bytecodealliance/wasmtime/issues/11224
alexcrichton requested dicej for a review on PR #11250.
alexcrichton commented on PR #11250:
Ah I also added a new
AsAccessorhelper trait here to assist with functions-taking-this-as-a-bound to make those a bit easier to write (in theory at least)
rvolosatovs submitted PR review.
dicej submitted PR review.
dicej created PR review comment:
/// Panics if the store that the [`Accessor`] is derived from does not own
dicej created PR review comment:
/// Panics if the store that the [`Accessor`] is derived from does not own... just to make it consistent with the corresponding doc comments below
dicej created PR review comment:
/// Panics if the store that the [`Accessor`] is derived from does not own
dicej created PR review comment:
/// Panics if the store that the [`Accessor`] is derived from does not own
alexcrichton updated PR #11250.
alexcrichton has enabled auto merge for PR #11250.
alexcrichton merged PR #11250.
Last updated: Dec 06 2025 at 06:05 UTC