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 ntex::http::client::Connector;
use ntex::time::Millis;
let connector = Connector::default()
.timeout(Millis(5_000))
.finish();
Implementations
Connection timeout.
i.e. max time to connect to remote host including dns name resolution. Set to 1 second by default.
Use openssl connector for secured connections.
Use rustls connector for secured connections.
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.
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.
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.
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 3 seconds.
pub fn connector<Io, T>(self, connector: T) -> Self where
T: Service<TcpConnect<Uri>, Response = Io, Error = ConnectError> + 'static,
IoBoxed: From<Io>,
pub fn connector<Io, T>(self, connector: T) -> Self where
T: Service<TcpConnect<Uri>, Response = Io, Error = ConnectError> + 'static,
IoBoxed: From<Io>,
Use custom connector to open un-secured connections.
pub fn secure_connector<Io, T>(self, connector: T) -> Self where
T: Service<TcpConnect<Uri>, Response = Io, Error = ConnectError> + 'static,
IoBoxed: From<Io>,
pub fn secure_connector<Io, T>(self, connector: T) -> Self where
T: Service<TcpConnect<Uri>, Response = Io, Error = ConnectError> + 'static,
IoBoxed: From<Io>,
Use custom connector to open secure connections.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Connector
impl !UnwindSafe for Connector
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more