Skip to main content

Module traffic_writer

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§

BidirectionalWriter
A writer that can write both requests and responses.
DoNotWriteRequest
Marker struct to indicate that the request should not be printed.
DoNotWriteResponse
Marker struct to indicate that the response should not be printed.
PerMessageFileWriter
Writes every captured request and response to an independent file.
RequestWriterLayer
Middleware to print Http request in std format.
RequestWriterService
Middleware to print Http request in std format.
ResponseWriterLayer
Layer that applies ResponseWriterService which prints the http response in std format.
ResponseWriterService
Middleware to print Http responses in std format.

Enums§

BidirectionalMessage
The internal message type for the BidirectionalWriter.
WriterMode
Http writer mode.

Traits§

RequestWriter
A trait for writing http requests.
ResponseWriter
A trait for writing http responses.