1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 01:31:57 +02:00

allow to use Connection for sending client request

This commit is contained in:
Nikolay Kim
2018-02-21 22:53:23 -08:00
parent 4a07430e8e
commit 4a9c1ae894
4 changed files with 106 additions and 27 deletions

View File

@@ -13,7 +13,7 @@ use body::Body;
use error::Error;
use headers::ContentEncoding;
use super::pipeline::SendRequest;
use super::connector::ClientConnector;
use super::connector::{Connection, ClientConnector};
/// An HTTP Client Request
pub struct ClientRequest {
@@ -179,9 +179,14 @@ impl ClientRequest {
SendRequest::new(self)
}
/// Send request using custom connector
pub fn with_connector(self, conn: Addr<Unsync, ClientConnector>) -> SendRequest {
SendRequest::with_connector(self, conn)
}
/// Send request using existing Connection
pub fn with_connection(self, conn: Connection) -> SendRequest {
SendRequest::with_connection(self, conn)
}
}