Skip to main content

Module trace

Module trace 

Source
Expand description

Live match-trace channel — RFC 006.

§What this module provides

A structured event stream that lets a GUI subscriber observe every incoming HTTP request alongside the rule that matched (or a “miss” if no rule matched). Events are emitted in-process via a bounded tokio::sync::broadcast channel.

§What is deliberately stubbed / deferred

The in-process channel is fully implemented. The transport layer (Unix-domain socket, named pipe, or TCP loopback) that forwards events to an out-of-process GUI subscriber is stubbed — the TraceTransport::accept_loop method panics with an explicit “not yet implemented” message. Implementing it requires OS-specific IPC plumbing that is scoped to a future release.

§Back-pressure

The channel is bounded by TRACE_CHANNEL_CAPACITY. When the channel is full (subscriber too slow), broadcast::Sender::send returns SendError; the emitter drops the event and increments dropped_count so the next event can report how many were lost.

Structs§

MatchTraceEvent
A single request/response trace event.
RequestSummary
Key fields from the incoming HTTP request.
TraceEmitter
Shared handle to the trace broadcast channel.
TraceTransport
Stub transport layer.

Enums§

Outcome
What the server decided to do with the request.
TraceTransportConfig
Configuration for the out-of-process trace transport.

Constants§

TRACE_CHANNEL_CAPACITY
Capacity of the in-process broadcast channel.

Functions§

now_ms
Current time as Unix milliseconds.