File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -47,14 +47,12 @@ pub use http_types;
47
47
/// trait from there together with all existing HTTP client implementations.__
48
48
///
49
49
/// ## Spawning new request from middleware
50
- /// When threading the trait through a layer of middleware, the middleware must be able to perform
51
- /// new requests. In order to enable this we pass an `HttpClient` instance through the middleware,
52
- /// with a `Clone` implementation. In order to spawn a new request, `clone` is called, and a new
53
- /// request is enabled.
54
50
///
55
- /// How `Clone` is implemented is up to the implementors, but in an ideal scenario combining this
56
- /// with the `Client` builder will allow for high connection reuse, improving latency.
57
- pub trait HttpClient : std:: fmt:: Debug + Unpin + Send + Sync + Clone + ' static {
51
+ /// When threading the trait through a layer of middleware, the middleware must be able to perform
52
+ /// new requests. In order to enable this efficiently an `HttpClient` instance may want to be passed
53
+ /// though middleware for one of its own requests, and in order to do so should be wrapped in an
54
+ /// `Rc`/`Arc` to enable reference cloning.
55
+ pub trait HttpClient : std:: fmt:: Debug + Unpin + Send + Sync + ' static {
58
56
/// The associated error type.
59
57
type Error : Send + Sync + Into < Error > ;
60
58
You can’t perform that action at this time.
0 commit comments