Commit 0edd1c8
committed
feat(client):
this commit introduces a new trait implementation for
`hyper::client::conn::TrySendError<T>`.
this commit allows a `TrySendError<T>` to be constructed `From` a
conventional `hyper::Error`.
one example of a motivating use case for this change is that this is
needed in order to use interfaces like
`hyper::client::conn::http2::SendRequest::try_send_request()` or
`hyper::client::conn::http1::SendRequest::try_send_request()` in the
context of tower middleware; the `Service<T>` trait's signature is such
that the same error type be returned from `Service::poll_ready()` and
`Service::call()`.
thus, the `?` operator may construct a `TrySendError<T>` from errors
possibly returned by
`hyper::client::conn::http2::SendRequest::poll_ready()` or
`hyper::client::conn::http1::SendRequest::poll_ready()`, within a
`Service<T>` that eventually calls `try_send_request()` in the context
of `Service::call()`.
---
see:
* #3691
* https://docs.rs/hyper/latest/hyper/client/conn/struct.TrySendError.html
* https://docs.rs/hyper/latest/hyper/struct.Error.html
* https://docs.rs/hyper/latest/hyper/client/conn/http2/struct.SendRequest.html#method.try_send_request
* https://docs.rs/tower/latest/tower/trait.Service.html#associatedtype.Error
* https://docs.rs/hyper/latest/hyper/client/conn/http1/struct.SendRequest.html#method.poll_ready
* https://docs.rs/hyper/latest/hyper/client/conn/http2/struct.SendRequest.html#method.poll_ready
Signed-off-by: katelyn martin <git@katelyn.world>TrySendError<T> is From<Error>
1 parent 12d9b55 commit 0edd1c8
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
313 | 322 | | |
314 | 323 | | |
315 | 324 | | |
| |||
0 commit comments