Struct hyper_http_connector::HttpConnector
source · pub struct HttpConnector { /* private fields */ }
Expand description
A connector for the http
scheme.
Performs DNS resolution in a thread pool, and then connects over TCP.
Implementations§
source§impl HttpConnector
impl HttpConnector
sourcepub fn new(threads: usize) -> HttpConnector
pub fn new(threads: usize) -> HttpConnector
Construct a new HttpConnector.
Takes number of DNS worker threads.
sourcepub fn new_with_handle(threads: usize, handle: Handle) -> HttpConnector
pub fn new_with_handle(threads: usize, handle: Handle) -> HttpConnector
Construct a new HttpConnector with a specific Tokio handle.
sourcepub fn new_with_executor<E>(executor: E, handle: Option<Handle>) -> HttpConnectorwhere
E: Executor<HttpConnectorBlockingTask> + Send + Sync + 'static,
pub fn new_with_executor<E>(executor: E, handle: Option<Handle>) -> HttpConnectorwhere
E: Executor<HttpConnectorBlockingTask> + Send + Sync + 'static,
Construct a new HttpConnector.
Takes an executor to run blocking tasks on.
sourcepub fn enforce_http(&mut self, is_enforced: bool)
pub fn enforce_http(&mut self, is_enforced: bool)
Option to enforce all Uri
s have the http
scheme.
Enabled by default.
sourcepub fn set_keepalive(&mut self, dur: Option<Duration>)
pub fn set_keepalive(&mut self, dur: Option<Duration>)
Set that all sockets have SO_KEEPALIVE
set with the supplied duration.
If None
, the option will not be set.
Default is None
.
sourcepub fn set_nodelay(&mut self, nodelay: bool)
pub fn set_nodelay(&mut self, nodelay: bool)
Set that all sockets have SO_NODELAY
set to the supplied value nodelay
.
Default is false
.
sourcepub fn set_local_address(&mut self, addr: Option<IpAddr>)
pub fn set_local_address(&mut self, addr: Option<IpAddr>)
Set that all sockets are bound to the configured address before connection.
If None
, the sockets will not be bound.
Default is None
.
Trait Implementations§
source§impl Clone for HttpConnector
impl Clone for HttpConnector
source§fn clone(&self) -> HttpConnector
fn clone(&self) -> HttpConnector
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more