Trait tokio_proto::streaming::pipeline::ServerProto [] [src]

pub trait ServerProto<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::Request, Self::RequestBody, Self::Error>, SinkItem = Frame<Self::Response, Self::ResponseBody, Self::Error>>;
    type BindTransport: IntoFuture<Item = Self::Transport, Error = Error>;
    fn bind_transport(&self, io: T) -> Self::BindTransport;
}

A streaming, pipelined server 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.

Associated Types

Request headers.

Request body chunks.

Response headers.

Response body chunks.

Errors, which are used both for error frames and for the service itself.

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

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

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

Required Methods

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

Implementors