tokio_proto::streaming::pipeline

Trait ClientProto

Source
pub trait ClientProto<T: 'static>: 'static {
    type Request: 'static;
    type RequestBody: 'static;
    type Response: 'static;
    type ResponseBody: 'static;
    type Error: From<Error> + 'static;
    type Transport: Transport<Item = Frame<Self::Response, Self::ResponseBody, Self::Error>, SinkItem = Frame<Self::Request, Self::RequestBody, Self::Error>>;
    type BindTransport: IntoFuture<Item = Self::Transport, Error = Error>;

    // Required method
    fn bind_transport(&self, io: T) -> Self::BindTransport;
}
Expand description

A streaming, pipelined client protocol.

The T parameter is used for the I/O object used to communicate, which is supplied in bind_transport.

For simple protocols, the Self type is often a unit struct. In more advanced cases, Self may contain configuration information that is used for setting up the transport in bind_transport.

Required Associated Types§

Source

type Request: 'static

The type of request headers.

Source

type RequestBody: 'static

The type of request body chunks.

Source

type Response: 'static

The type of response headers.

Source

type ResponseBody: 'static

The type of response body chunks.

Source

type Error: From<Error> + 'static

The type of error frames.

Source

type Transport: Transport<Item = Frame<Self::Response, Self::ResponseBody, Self::Error>, SinkItem = Frame<Self::Request, Self::RequestBody, Self::Error>>

The frame transport, which usually take T as a parameter.

Source

type BindTransport: IntoFuture<Item = Self::Transport, Error = Error>

A future for initializing a transport from an I/O object.

In simple cases, Result<Self::Transport, Self::Error> often suffices.

Required Methods§

Source

fn bind_transport(&self, io: T) -> Self::BindTransport

Build a transport from the given I/O object, using self for any configuration.

Implementors§