feat!(client): expose whether a connection is reused from the pool #145
feat!(client): expose whether a connection is reused from the pool #145magurotuna wants to merge 2 commits intohyperium:masterfrom
Conversation
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.
d17eeb0 to
0772c00
Compare
|
Thanks for opening this! It does seem like the right direction to go... @nox, since you added the original type, I'm curious if you have any thoughts about this direction. I'd probably suggest we should wait on the breaking change (it disrupts the crates providing |
|
I'm not sure I gather why this can't be provided by |
|
Yea, that's fair. I'd probably be fine with that. @magurotuna any reason you think that isn't ideal? |
|
The reason I prefer to introduce a new struct wrapping the existing |

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 thatConnectedoffers 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 toConnectedin the future without worrying aboutError::connect_info().This introduces a new type
ErrorConnectInfothat 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