Struct tokio_proto::TcpClient
[−]
[src]
pub struct TcpClient<Kind, P> { /* fields omitted */ }
Builds client connections to external services.
To connect to a service, you need a client protocol implementation; see the crate documentation for guidance.
At the moment, this builder offers minimal configuration, but more will be added over time.
Methods
impl<Kind, P> TcpClient<Kind, P> where
P: BindClient<Kind, TcpStream>,
[src]
P: BindClient<Kind, TcpStream>,
pub fn new(protocol: P) -> TcpClient<Kind, P>
[src]
Create a builder for the given client protocol.
To connect to a service, you need a client protocol implementation; see the crate documentation for guidance.
pub fn connect(&self, addr: &SocketAddr, handle: &Handle) -> Connect<Kind, P>
[src]
Establish a connection to the given address.
Return value
Returns a future for the establishment of the connection. When the
future completes, it yields an instance of Service
for interacting
with the server.