Repository navigation
Keep owned builders while making async setup futures Send - #320
Closed
alexliesenfeld wants to merge 5 commits into
Closed
alexliesenfeld wants to merge 5 commits into
alexliesenfeld wants to merge 5 commits into
Conversation
Refactor `When` and rule builder APIs to mutate configs in place via `&mut` references, removing `Rc<Cell>` plumbing across proxy/server setup paths and deleting the now-unused `update_cell` helper.
This was referenced Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #325, using the renamed
owned-builders-sendbranch and including #322. This PR was closed automatically by GitHub when its source branch was renamed. The original description and discussion are preserved below.Follow-up to #257, targeting its
breakage_mut_refbranch.Keep async registration usable inside
tokio::spawnwhile retaining the existing owned builder API. Helpers such asfn with_path(when: When, path: &str) -> When, structs storing builders, immediate'staticcallbacks,Anyintegrations, staged forwarding/proxy filters, and shared recording configuration continue to work without lifetime changes.The
Rc<Cell<_>>handles now live in a synchronous block that produces an owned configuration before the first.await. This covers mock, forwarding, proxy and recording setup. Unwind guards preserve configured values when a setter panic is caught, including a recording filter's nested configuration.The tradeoff is that the builders themselves remain
!Send/!Syncand retain their existing allocations and reference counting. Setup futures areSendwhen their inputs permit it; no extra publicSendbounds are added.Validation:
tokio::spawn, owned helper composition, staged filters and caught panics.proxyalone, andrecordalone.clippy::let_and_returnallowed. The unchanged Replace Rc<Cell> builders with mutable references #257 head fails that same lint insrc/server/tls.rs; this patch leaves that unrelated code alone.