stream bodies through a generated seam with range and 206 answers - #288
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
http(body = "stream")lands:BodySource(a pull trait blanket-implemented overstd::io::Read) andStreamedAnswerpublish in the service's own module — the author's signature names them directly.Fullanswers the declared status;Partialanswers 206 with the handler-builtcontent-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.streambesideheader_outstays refused with a message pointing atStreamedAnswer::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.