Module connect
Connectors used by the Client.
This module contains:
- A default
HttpConnectorthat does DNS resolution and establishes connections over TCP. - Types to build custom connectors.
Connectors
A "connector" is a Service that takes a Uri destination, and
its Response is some type implementing Read, Write,
and Connection.
Custom Connectors
A simple connector that ignores the Uri destination and always returns
a TCP connection to the same address could be written like this:
let connector = service_fn
Or, fully written out:
use ;
use Uri;
use TcpStream;
use Service;
;
It's worth noting that for TcpStreams, the HttpConnector is a
better starting place to extend from.
Modules
Structs
-
CaptureConnection
CaptureConnectionallows callers to captureConnectedinformation - Connected Extra information about the connected transport.
-
HttpConnector
A connector for the
httpscheme. - HttpInfo Extra information about the transport when an HttpConnector is used.
Traits
- Connect Connect to a destination, returning an IO transport.
- Connection Describes a type returned by a connector.
Functions
- capture_connection Capture the connection for a given request