Skip to main content

Module stream

Module stream 

Available on crate features http and std only.
Expand description

Streaming serialization of HAR entries and bodies, independent of inspection.

Structs§

BodyStats
Length and encoding detected from a complete pass over a stable body.
HarObjectWriter
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.
HarEntryExtension
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-urlencoded bodies, 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 utf8 for 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.