Struct ntex::http::client::Connector [−][src]
pub struct Connector { /* fields omitted */ }
Expand description
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 ntex::http::client::Connector; let connector = Connector::default() .timeout(Duration::from_secs(5)) .finish();
Implementations
impl Connector
[src]
impl Connector
[src]pub fn timeout(self, timeout: Duration) -> Self
[src]
pub fn timeout(self, timeout: Duration) -> Self
[src]Connection timeout, i.e. max time to connect to remote host including dns name resolution. Set to 1 second by default.
pub fn openssl(self, connector: OpensslConnector) -> Self
[src]
pub fn openssl(self, connector: OpensslConnector) -> Self
[src]Use openssl connector for secured connections.
pub fn rustls(self, connector: Arc<ClientConfig>) -> Self
[src]
pub fn rustls(self, connector: Arc<ClientConfig>) -> Self
[src]Use rustls connector for secured connections.
pub fn limit(self, limit: usize) -> Self
[src]
pub fn limit(self, limit: usize) -> Self
[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 keep_alive(self, dur: Duration) -> Self
[src]
pub fn keep_alive(self, dur: Duration) -> Self
[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 lifetime(self, dur: Duration) -> Self
[src]
pub fn lifetime(self, dur: Duration) -> Self
[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) -> Self
[src]
pub fn disconnect_timeout(self, dur: Duration) -> Self
[src]Set server connection disconnect timeout.
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 connector<T, U>(self, connector: T) -> Self where
U: AsyncRead + AsyncWrite + Unpin + 'static,
T: Service<Request = TcpConnect<Uri>, Response = (U, Protocol), Error = ConnectError> + 'static,
[src]
pub fn connector<T, U>(self, connector: T) -> Self where
U: AsyncRead + AsyncWrite + Unpin + 'static,
T: Service<Request = TcpConnect<Uri>, Response = (U, Protocol), Error = ConnectError> + 'static,
[src]Use custom connector to open un-secured connections.
pub fn secure_connector<T, U>(self, connector: T) -> Self where
U: AsyncRead + AsyncWrite + Unpin + 'static,
T: Service<Request = TcpConnect<Uri>, Response = (U, Protocol), Error = ConnectError> + 'static,
[src]
pub fn secure_connector<T, U>(self, connector: T) -> Self where
U: AsyncRead + AsyncWrite + Unpin + 'static,
T: Service<Request = TcpConnect<Uri>, Response = (U, Protocol), Error = ConnectError> + 'static,
[src]Use custom connector to open secure connections.
pub fn finish(
self
) -> impl Service<Request = Connect, Response = impl Connection, Error = ConnectError> + Clone
[src]
pub fn finish(
self
) -> impl Service<Request = Connect, Response = impl Connection, Error = ConnectError> + Clone
[src]Finish configuration process and create connector service.
The Connector builder always concludes by calling finish()
last in
its combinator chain.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Connector
impl !Send for Connector
impl !Sync for Connector
impl Unpin for Connector
impl !UnwindSafe for Connector
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self