Module stream
Available on crate features
http and std only.Expand description
Streaming serialization of HAR entries and bodies, independent of inspection.
Structs§
- Body
Stats - Length and encoding detected from a complete pass over a stable body.
- HarObject
Writer - Writes typed fields of a HAR object, with a reusable serialization buffer. Protocol extensions use this to append their own typed values or streams.
Traits§
- HarBody
- A stable body that can be reopened for encoding detection and serialization. Each reader must yield the same bytes. Implementations can borrow memory or stream from files and other storage; no inspection dependency is required.
- HarEntry
Extension - Optional protocol-owned HAR fields, written from typed values with backpressure.
()adds no fields.
Functions§
- scan
- Scan without retaining body data, including UTF-8 sequences split across reads.
- write_
entry - Serialize a typed HAR entry with streamed bodies and protocol-owned extensions.
Metadata is serialized with Serde; only body fields require incremental JSON
escaping. A cancelled write may leave partial output, so stage published files.
Existing post parameters are preserved. For
application/x-www-form-urlencodedbodies, absent or empty parameters are derived from the nonempty body stream. - write_
json_ string - Stream one JSON string, escaping UTF-8 or encoding binary without a body-sized buffer.
- write_
web_ socket_ message - Write a Chromium HAR WebSocket message with a streamed payload.
Set
utf8for text or already base64-encoded HAR data; raw binary payloads are base64-encoded incrementally. The opcode determines how HAR readers interpret the data: this extension has no separate encoding field.