Expand description
Background interception actor.
The crate-private run_actor is the rule-driven loop spawned by
InterceptBuilder::start. It
owns a single tab’s Fetch.* interception lifecycle:
- Subscribes to
Fetch.requestPausedon the suppliedSessionHandlebefore firingFetch.enable. Mirrors the subscriber pattern used by the zendriver core’s frame-lifecycle and network-idle trackers — events Chrome fires between the enable round-trip and our subscription would otherwise be dropped, and theMockConnectiontest harness inzendriver-transport(gatedfeature = "testing") never replies to fire-and-forget enables anyway. - Sends
Fetch.enable { patterns, handleAuthRequests }with the explicit pattern list supplied by the builder;handleAuthRequestsflips totruewhen the builder also calledInterceptBuilder::handle_authso Chrome surfacesFetch.authRequiredevents the actor answers withFetch.continueWithAuth. - Per
Fetch.requestPausedevent: walksrulesin registration order, first match wins, dispatches the matching action’s CDP call. No match → plainFetch.continueRequest(let through). - On cancellation: fires
Fetch.disableand exits. The handle returned by the builder owns aCancellationTokenthat fires onDrop, so interception always tears down deterministically when the handle leaves scope.
InterceptHandle is the user-facing RAII guard. Its stop method is
the explicit-shutdown path — it cancels the token and awaits a oneshot
the actor signals on exit, so the caller observes Fetch.disable has
reached the wire before stop() returns.
Structs§
- Intercept
Handle - RAII guard returned by
InterceptBuilder::start(Task 7).