alexcrichton opened PR #11354 from alexcrichton:refactor-guards to bytecodealliance:main:
This is a follow-up to https://github.com/bytecodealliance/wasmtime/pull/11325 with a number of cosmetic changes about
the shape of the API and structure of the internals:
{Stream,Future}{Reader,Writer}::guardis now an alternative
constructor toGuard*::new(import fewer types).Internally
WithAccessorandDropWithStoreare removed in favor of
directDrop for Guard*impls.An
Optionis used to replaceManuallyDropandunsafecode.
{Stream,Future}{Reader,Writer}::close{,_with}now take&mut self
instead ofselfto be more composable with&mut selfarguments
duringDropfor other structures (e.g. build-your-own
drop-with-store).The type parameters on
Guard*are simplified to justT, the future
or stream payload, andA: AsAccessor. This helps cut down on the
complexity of signatures.
Guard*types now haveinto_{stream,future}as an alternative to
.into()which doesn't require type annotations.
alexcrichton requested pchickey for a review on PR #11354.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11354.
alexcrichton requested dicej for a review on PR #11354.
alexcrichton commented on PR #11354:
I'll note the first commit here is from https://github.com/bytecodealliance/wasmtime/pull/11351, so only the second commit is for this PR
alexcrichton requested fitzgen for a review on PR #11354.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #11354.
alexcrichton requested wasmtime-wasi-reviewers for a review on PR #11354.
alexcrichton requested wasmtime-default-reviewers for a review on PR #11354.
alexcrichton updated PR #11354.
fitzgen submitted PR review:
LGTM, although I am not super familiar with this code
alexcrichton updated PR #11354.
alexcrichton edited a comment on PR #11354:
I'll note the first commit here is from https://github.com/bytecodealliance/wasmtime/pull/11351, so only the second commit is for this PREDIT: prereqs landed
dicej submitted PR review.
alexcrichton merged PR #11354.
Last updated: Dec 06 2025 at 07:03 UTC