alexcrichton opened PR #6770 from alexcrichton:mut-builder
to bytecodealliance:main
:
This commit changes the
WasiCtxBuilder
for preview2 to use a builder pattern more similar tostd::process::Command
where methods take&mut self
and return&mut Self
instead of takingself
and returningSelf
. This pattern enables more easily building up configuration over time throughout code where ownership transfer might otherwise be awkward.A small caveat to this is that the ergonomics of this pattern only really work out well if the final "build" method takes
&mut self
as well. In this situation it's difficult to try to figure out what's supposed to happen if this method is called twice, so I left it to panic for now so we can more easily update it in the future possibly.I'll also note that the original motivations for this come from the upgrade at https://github.com/fermyon/spin/pull/1678
alexcrichton requested jameysharp for a review on PR #6770.
alexcrichton requested wasmtime-core-reviewers for a review on PR #6770.
pchickey requested pchickey for a review on PR #6770.
alexcrichton closed without merge PR #6770.
alexcrichton reopened PR #6770.
alexcrichton updated PR #6770.
pchickey submitted PR review.
alexcrichton updated PR #6770.
alexcrichton has enabled auto merge for PR #6770.
alexcrichton updated PR #6770.
alexcrichton updated PR #6770.
alexcrichton updated PR #6770.
alexcrichton requested wasmtime-default-reviewers for a review on PR #6770.
alexcrichton has enabled auto merge for PR #6770.
alexcrichton updated PR #6770.
alexcrichton has enabled auto merge for PR #6770.
alexcrichton merged PR #6770.
Last updated: Nov 22 2024 at 17:03 UTC