Skip to content

stream bodies through a generated seam with range and 206 answers - #288

Merged
eburgos merged 2 commits into
masterfrom
streamed-bodies
Sep 6, 2026
Merged

stream bodies through a generated seam with range and 206 answers#288
eburgos merged 2 commits into
masterfrom
streamed-bodies

Conversation

@eburgos

@eburgos eburgos commented Sep 6, 2026

Copy link
Copy Markdown
Owner

http(body = "stream") lands: BodySource (a pull trait blanket-implemented over std::io::Read) and StreamedAnswer publish in the service's own module — the author's signature names them directly. Full answers the declared status; Partial answers 206 with the handler-built content-range; the body crosses the seam undrained both directions, and the client hands back a source satisfying the same trait even for a buffered response. Token-level tests assert no runtime crate (tokio/futures/bytes) in the expansion.

stream beside header_out stays refused with a message pointing at StreamedAnswer::Partial — author-declared extra headers on streamed answers arrive with the composition follow-up.

Gate: just lint, just test-named-features, and all-features clippy green; 13 new tests.

A body = stream operation answers through BodySource, a pull trait
blanket-implemented over std::io::Read and published in the service's
own module, since the author's signature names StreamedAnswer
directly: Full answers the declared status, Partial answers 206 with
the content-range the handler built, and the body crosses the seam
undrained either way. The client checks 206 ahead of the declared
status, reads content-range before consuming, and hands back a source
that satisfies the same trait even when the response arrived
buffered. The expansion names no runtime crate - asserted at token
level - and stream beside header_out stays refused, pointing at
StreamedAnswer::Partial, until composition is built.
@eburgos
eburgos merged commit 701c520 into master Sep 6, 2026
@eburgos
eburgos deleted the streamed-bodies branch September 6, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant