pub struct HttpConnector<R = GaiResolver> { /* private fields */ }
Expand description

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.

Implementations

Construct a new HttpConnector.

Takes number of DNS worker threads.

Construct a new HttpConnector.

Takes an executor to run blocking getaddrinfo tasks on.

Construct a new HttpConnector using the TokioThreadpoolGaiResolver.

This resolver requires the threadpool runtime to be used.

Construct a new HttpConnector.

Takes a Resolve to handle DNS lookups.

Option to enforce all Uris have the http scheme.

Enabled by default.

Set a handle to a Reactor to register connections to.

If None, the implicit default reactor will be used.

Set that all sockets have SO_KEEPALIVE set with the supplied duration.

If None, the option will not be set.

Default is None.

Set that all sockets have SO_NODELAY set to the supplied value nodelay.

Default is false.

Sets the value of the SO_SNDBUF option on the socket.

Sets the value of the SO_RCVBUF option on the socket.

Set that all sockets are bound to the configured address before connection.

If None, the sockets will not be bound.

Default is None.

Set timeout for hostname resolution.

If None, then no timeout is applied by the connector, making it subject to the timeout imposed by the operating system.

Default is None.

Set the connect timeout.

If a domain resolves to multiple IP addresses, the timeout will be evenly divided across them.

Default is None.

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.

Set that all socket have SO_REUSEADDR set to the supplied value reuse_address.

Default is false.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The connected IO Stream.

An error occured when trying to connect.

A Future that will resolve to the connected Transport.

Connect to a destination.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.