[−][src]Struct actix_web::client::Connector
Manages http client network connectivity
The Connector
type uses a builder-like combinator pattern for service
construction that finishes by calling the .finish()
method.
use std::time::Duration; use actix_http::client::Connector; let connector = Connector::new() .timeout(Duration::from_secs(5)) .finish();
Methods
impl Connector<(), ()>
[src]
pub fn new(
) -> Connector<impl Clone + Service<Request = Connect<Uri>, Response = Connection<Uri, TcpStream>, Error = ConnectError>, TcpStream>
[src]
) -> Connector<impl Clone + Service<Request = Connect<Uri>, Response = Connection<Uri, TcpStream>, Error = ConnectError>, TcpStream>
impl<T, U> Connector<T, U>
[src]
pub fn connector<T1, U1>(self, connector: T1) -> Connector<T1, U1> where
T1: Service<Request = Connect<Uri>, Response = Connection<Uri, U1>, Error = ConnectError> + Clone,
U1: AsyncRead + AsyncWrite + Debug,
[src]
T1: Service<Request = Connect<Uri>, Response = Connection<Uri, U1>, Error = ConnectError> + Clone,
U1: AsyncRead + AsyncWrite + Debug,
Use custom connector.
impl<T, U> Connector<T, U> where
T: Service<Request = Connect<Uri>, Response = Connection<Uri, U>, Error = ConnectError> + Clone + 'static,
U: AsyncWrite + Debug + 'static + AsyncRead,
[src]
T: Service<Request = Connect<Uri>, Response = Connection<Uri, U>, Error = ConnectError> + Clone + 'static,
U: AsyncWrite + Debug + 'static + AsyncRead,
pub fn timeout(self, timeout: Duration) -> Connector<T, U>
[src]
Connection timeout, i.e. max time to connect to remote host including dns name resolution. Set to 1 second by default.
pub fn ssl(self, connector: SslConnector) -> Connector<T, U>
[src]
Use custom SslConnector
instance.
pub fn rustls(self, connector: Arc<ClientConfig>) -> Connector<T, U>
[src]
pub fn limit(self, limit: usize) -> Connector<T, U>
[src]
Set total number of simultaneous connections per type of scheme.
If limit is 0, the connector has no limit. The default limit size is 100.
pub fn conn_keep_alive(self, dur: Duration) -> Connector<T, U>
[src]
Set keep-alive period for opened connection.
Keep-alive period is the period between connection usage. If the delay between repeated usages of the same connection exceeds this period, the connection is closed. Default keep-alive period is 15 seconds.
pub fn conn_lifetime(self, dur: Duration) -> Connector<T, U>
[src]
Set max lifetime period for connection.
Connection lifetime is max lifetime of any opened connection until it is closed regardless of keep-alive period. Default lifetime period is 75 seconds.
pub fn disconnect_timeout(self, dur: Duration) -> Connector<T, U>
[src]
Set server connection disconnect timeout in milliseconds.
Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the socket get dropped. This timeout affects only secure connections.
To disable timeout set value to 0.
By default disconnect timeout is set to 3000 milliseconds.
pub fn finish(
self
) -> impl Clone + Service<Request = Connect, Response = impl Connection, Error = ConnectError>
[src]
self
) -> impl Clone + Service<Request = Connect, Response = impl Connection, Error = ConnectError>
Finish configuration process and create connector service.
The Connector builder always concludes by calling finish()
last in
its combinator chain.
Auto Trait Implementations
impl<T, U> Send for Connector<T, U> where
T: Send,
U: Send,
T: Send,
U: Send,
impl<T, U> Unpin for Connector<T, U> where
T: Unpin,
U: Unpin,
T: Unpin,
U: Unpin,
impl<T, U> Sync for Connector<T, U> where
T: Sync,
U: Sync,
T: Sync,
U: Sync,
impl<T, U> !UnwindSafe for Connector<T, U>
impl<T, U> !RefUnwindSafe for Connector<T, U>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,