[−][src]Struct hyper::client::HttpConnector
A connector for the http
scheme.
Performs DNS resolution in a thread pool, and then connects over TCP.
Note
Sets the HttpInfo
value on responses, which includes
transport information such as the remote socket address used.
Methods
impl HttpConnector
[src]
pub fn new(threads: usize) -> HttpConnector
[src]
Construct a new HttpConnector.
Takes number of DNS worker threads.
pub fn new_with_executor<E: 'static>(
executor: E,
handle: Option<Handle>
) -> HttpConnector where
E: Executor<GaiTask> + Send + Sync,
[src]
executor: E,
handle: Option<Handle>
) -> HttpConnector where
E: Executor<GaiTask> + Send + Sync,
Construct a new HttpConnector.
Takes an executor to run blocking getaddrinfo
tasks on.
impl HttpConnector<TokioThreadpoolGaiResolver>
[src]
pub fn new_with_tokio_threadpool_resolver() -> Self
[src]
Construct a new HttpConnector using the TokioThreadpoolGaiResolver
.
This resolver requires the threadpool runtime to be used.
impl<R> HttpConnector<R>
[src]
pub fn new_with_resolver(resolver: R) -> HttpConnector<R>
[src]
Construct a new HttpConnector.
Takes a Resolve
to handle DNS lookups.
pub fn enforce_http(&mut self, is_enforced: bool)
[src]
Option to enforce all Uri
s have the http
scheme.
Enabled by default.
pub fn set_reactor(&mut self, handle: Option<Handle>)
[src]
Set a handle to a Reactor
to register connections to.
If None
, the implicit default reactor will be used.
pub fn set_keepalive(&mut self, dur: Option<Duration>)
[src]
Set that all sockets have SO_KEEPALIVE
set with the supplied duration.
If None
, the option will not be set.
Default is None
.
pub fn set_nodelay(&mut self, nodelay: bool)
[src]
Set that all sockets have SO_NODELAY
set to the supplied value nodelay
.
Default is false
.
pub fn set_send_buffer_size(&mut self, size: Option<usize>)
[src]
Sets the value of the SO_SNDBUF option on the socket.
pub fn set_recv_buffer_size(&mut self, size: Option<usize>)
[src]
Sets the value of the SO_RCVBUF option on the socket.
pub fn set_local_address(&mut self, addr: Option<IpAddr>)
[src]
Set that all sockets are bound to the configured address before connection.
If None
, the sockets will not be bound.
Default is None
.
pub fn set_happy_eyeballs_timeout(&mut self, dur: Option<Duration>)
[src]
Set timeout for RFC 6555 (Happy Eyeballs) algorithm.
If hostname resolves to both IPv4 and IPv6 addresses and connection cannot be established using preferred address family before timeout elapses, then connector will in parallel attempt connection using other address family.
If None
, parallel connection attempts are disabled.
Default is 300 milliseconds.
pub fn set_reuse_address(&mut self, reuse_address: bool) -> &mut Self
[src]
Set that all socket have SO_REUSEADDR
set to the supplied value reuse_address
.
Default is false
.
Trait Implementations
impl<R> Connect for HttpConnector<R> where
R: Resolve + Clone + Send + Sync,
R::Future: Send,
[src]
R: Resolve + Clone + Send + Sync,
R::Future: Send,
type Transport = TcpStream
The connected IO Stream.
type Error = Error
An error occured when trying to connect.
type Future = HttpConnecting<R>
A Future that will resolve to the connected Transport.
fn connect(&self, dst: Destination) -> Self::Future
[src]
impl<R: Clone> Clone for HttpConnector<R>
[src]
fn clone(&self) -> HttpConnector<R>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R: Debug> Debug for HttpConnector<R>
[src]
Auto Trait Implementations
impl<R> Send for HttpConnector<R> where
R: Send,
R: Send,
impl<R> Unpin for HttpConnector<R> where
R: Unpin,
R: Unpin,
impl<R> Sync for HttpConnector<R> where
R: Sync,
R: Sync,
impl<R = GaiResolver> !UnwindSafe for HttpConnector<R>
impl<R = GaiResolver> !RefUnwindSafe for HttpConnector<R>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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,