Module traffic_writer
Available on crate features
http and std only.Expand description
Middleware to write Http traffic in std format.
Can be useful for cli / debug purposes.
Built-in shared writers keep complete messages ordered through one output
task. Each message has capacity for one captured frame; a slow or long-lived
message therefore applies asynchronous backpressure to later body streams
instead of buffering their complete contents in memory. Use a per-message
writer when messages must be captured concurrently without sharing that
backpressure. In particular, a shared bidirectional body writer can stall a
full-duplex exchange when either peer waits for the other direction to make
progress; use PerMessageFileWriter or another independent writer for
such traffic.
Structs§
- Bidirectional
Writer - A writer that can write both requests and responses.
- DoNot
Write Request - Marker struct to indicate that the request should not be printed.
- DoNot
Write Response - Marker struct to indicate that the response should not be printed.
- PerMessage
File Writer - Writes every captured request and response to an independent file.
- Request
Writer Layer - Middleware to print Http request in std format.
- Request
Writer Service - Middleware to print Http request in std format.
- Response
Writer Layer - Layer that applies
ResponseWriterServicewhich prints the http response in std format. - Response
Writer Service - Middleware to print Http responses in std format.
Enums§
- Bidirectional
Message - The internal message type for the
BidirectionalWriter. - Writer
Mode - Http writer mode.
Traits§
- Request
Writer - A trait for writing http requests.
- Response
Writer - A trait for writing http responses.