feat!(client): expose whether a connection is reused from the pool #145
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.
This is a prototype of my idea proposed in hyperium/hyper#3727 (comment).
The obvious downside of this approach is that this is a breaking change as the return type of
Error::connect_info()
is changed fromOption<&Connected>
toOption<&ErroredConnectInfo>
, but this may be good in a sense that not all of the methods thatConnected
offers make sense in the context of connection error - introducing a dedicated type would allow not only for exposing methods that are relevant, but also for making changes toConnected
in the future without worrying aboutError::connect_info()
.This introduces a new type
ErrorConnectInfo
that contains information about connection pool as well as transport-related data.This new type can now be obtained from the
Error::connect_info()
method, which means that this is a breaking change as the return type from the method has changed. That said, all information that was available on the previous return type is available on the new type through various getter methods.Closes hyperium/hyper#3727