pub enum TraceEvent {
ConnectTcp {
phase: TracePhase,
host: String,
port: u16,
},
ConnectUnixSocket {
phase: TracePhase,
path: String,
},
StartTls {
phase: TracePhase,
server_hostname: String,
},
Retry {
phase: TracePhase,
delay_ms: u64,
},
Close {
phase: TracePhase,
},
SendRequestHeaders {
phase: TracePhase,
method: String,
target: String,
},
SendRequestBody {
phase: TracePhase,
},
ReceiveResponseHeaders {
phase: TracePhase,
status: u16,
},
ReceiveResponseBody {
phase: TracePhase,
},
ResponseClosed {
phase: TracePhase,
},
}Expand description
Typed lifecycle events emitted by the transport layer.
Event names and phases match httpcore 1.0.9’s Trace context manager
vocabulary. Each event has a phase (Started, Complete, Failed)
and carries structured metadata as a map of string keys to opaque values.
The Python compatibility layer maps these to the dotted event names
that HTTPX’s trace extension expects (e.g. connect_tcp.started).
Variants§
ConnectTcp
TCP connection to the target host.
Fields
phase: TracePhaseLifecycle phase.
ConnectUnixSocket
Unix domain socket connection.
StartTls
TLS handshake (client hello through finished).
Fields
phase: TracePhaseLifecycle phase.
Retry
Connection retry with backoff delay.
Fields
phase: TracePhaseLifecycle phase.
Close
Connection closed.
Fields
phase: TracePhaseLifecycle phase.
SendRequestHeaders
HTTP/1.1 or HTTP/2 request headers sent.
Fields
phase: TracePhaseLifecycle phase.
SendRequestBody
HTTP/1.1 or HTTP/2 request body chunks sent.
Fields
phase: TracePhaseLifecycle phase.
ReceiveResponseHeaders
HTTP/1.1 or HTTP/2 response status/headers received.
ReceiveResponseBody
HTTP/1.1 or HTTP/2 response body chunks received.
Fields
phase: TracePhaseLifecycle phase.
ResponseClosed
Response stream closed; connection returned to pool or dropped.
Fields
phase: TracePhaseLifecycle phase.
Trait Implementations§
Source§impl Clone for TraceEvent
impl Clone for TraceEvent
Source§fn clone(&self) -> TraceEvent
fn clone(&self) -> TraceEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more