Expand description
Native HTTP bodies, following Protocol::HTTP::Body.
ReadableBody combines synchronous observations and abandonment with
asynchronous frame reads using explicit cancellation. I/O-backed
implementations retain explicitly constructed scheduler-bound capabilities.
Body length describes the whole representation. It does not decrease as chunks
are consumed, and a HeadBody body may report a nonzero length while emitting no
data. Reads move owned BodyFrame events, including trailing fields and
completion. An empty data chunk is distinct from completion.
BodyReader and BodyWriter are bounded consumer/producer halves.
A protocol driver pulls data directly; bodies do not spawn tasks.
Structs§
- Body
Reader - The readable half of a bounded, single-producer body.
- Body
Writer - The unique output half of a
BodyReaderbody. - Buffered
Body - An in-memory, replayable sequence of chunks.
- Empty
Body - A ready body with no data and a representation length of zero.
- Head
Body - An empty body retaining the representation length for a HEAD response.
Enums§
- Body
Error - Failures shared by writable bodies and their producers.
Failedreports the producer’s error as its source, so callers can downcast it. - Body
Frame - One owned body event. Initial message fields live in the message head;
Headerscarries trailing fields, after which no more data is permitted.
Traits§
- Readable
Body - Protocol-independent body observations and lifecycle.
- Writable
Body - A body producer accepting owned frames with backpressure. Normal closure preserves accepted frames; failure abandons unfinished output. Flushing exposes accepted frames to the consumer, without promising peer receipt.