docs: expand crate-level cancel safety section with HTTP/1 vs HTTP/2 - #4156
Open
MsfPablo wants to merge 1 commit into
Open
docs: expand crate-level cancel safety section with HTTP/1 vs HTTP/2#4156MsfPablo wants to merge 1 commit into
MsfPablo wants to merge 1 commit into
Conversation
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.
Closes #4054.
The crate-level
# Cancel safetysection insrc/lib.rsalready pointedreaders at the per-future docs, but didn't itself answer the question
that an
unstable_-doc reader actually has when they land on the crateroot: "what happens on the wire when I drop this?"
This change fills in the two-line stub with the protocol-specific
behavior, mirroring what
SendRequest::send_requestalready saysdownstream:
connection (no in-protocol per-request abort), and any subsequent
call on the same
SendRequestreturnsError::new_canceled().RST_STREAM(
CANCELerror code); the shared connection stays usable for otherin-flight and future requests.
The "see individual futures" pointer at the bottom is preserved so
the existing per-future
Cancel safetydocblocks remain the source oftruth for edge cases (e.g. the bidi client future or specific request
body streams).
Verified with
cargo doc --no-deps— no new warnings introduced.Disclosed: this contribution was prepared with the help of Claude (a
large language model). The human in the loop reviewed the diff against
the per-future
Cancel safetyparagraphs insrc/client/conn/http1.rsandsrc/client/conn/http2.rsand verifiedthe summary is faithful and not a paraphrase of anything external.