feat(client): add capture_connection#3144
Merged
seanmonstar merged 1 commit intohyperium:0.14.xfrom Feb 22, 2023
Merged
Conversation
a8b5029 to
60fa720
Compare
LucioFranco
reviewed
Feb 14, 2023
| /// client.request(request).await.expect("request failed"); | ||
| /// # } | ||
| /// ``` | ||
| pub fn capture_connection<B>(request: &mut crate::http::Request<B>) -> CaptureConnection { |
Author
There was a problem hiding this comment.
discussed offline, will defer for now but could add later
LucioFranco
reviewed
Feb 16, 2023
| pub(super) extra: Option<Extra>, | ||
| } | ||
|
|
||
| /// [`CaptureConnection`] allows callers to capture [`Connected`] information |
Member
There was a problem hiding this comment.
Does this need to live in this file or can we move it out?
Author
There was a problem hiding this comment.
can definitely be moved—any preference for final location?
Add `capture_connection` functionality. This allows callers to retrieve the `Connected` struct of the connection that was used internally by Hyper. This is in service of hyperium#2605. Although this uses `http::Extensions` under the hood, the API exposed explicitly hides that detail.
60fa720 to
d3c9b6a
Compare
seanmonstar
approved these changes
Feb 22, 2023
Member
seanmonstar
left a comment
There was a problem hiding this comment.
Looks real clear to me, love it!
oddgrd
pushed a commit
to oddgrd/hyper
that referenced
this pull request
Mar 7, 2023
) Add `capture_connection` functionality. This allows callers to retrieve the `Connected` struct of the connection that was used internally by Hyper. This is in service of hyperium#2605. Although this uses `http::Extensions` under the hood, the API exposed explicitly hides that detail.
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.
Add
capture_connectionfunctionality. This allows callers to retrieve theConnectedstruct of the connection that was used internally by Hyper. This is in service of #2605.This pairs with a coming PR that adds a
poisonAPI toConnected— the pair of these APIs makes it possible to avoid reusing connections that the client deems to be bad.Example usage:
Although this uses
http::Extensionsunder the hood, the API exposed explicitly hides that detail.