tokio_proto::streaming::pipeline::advanced

Trait Dispatch

Source
pub trait Dispatch {
    type Io;
    type In;
    type BodyIn;
    type Out;
    type BodyOut;
    type Error: From<Error>;
    type Stream: Stream<Item = Self::BodyIn, Error = Self::Error>;
    type Transport: Transport<Item = Frame<Self::Out, Self::BodyOut, Self::Error>, SinkItem = Frame<Self::In, Self::BodyIn, Self::Error>>;

    // Required methods
    fn transport(&mut self) -> &mut Self::Transport;
    fn dispatch(
        &mut self,
        message: PipelineMessage<Self::Out, Body<Self::BodyOut, Self::Error>, Self::Error>,
    ) -> Result<()>;
    fn poll(
        &mut self,
    ) -> Poll<Option<PipelineMessage<Self::In, Self::Stream, Self::Error>>, Error>;
    fn has_in_flight(&self) -> bool;
}
Expand description

Dispatch messages from the transport to the service

Required Associated Types§

Source

type Io

Type of underlying I/O object

Source

type In

Message written to transport

Source

type BodyIn

Body written to transport

Source

type Out

Messages read from the transport

Source

type BodyOut

Outbound body frame

Source

type Error: From<Error>

Transport error

Source

type Stream: Stream<Item = Self::BodyIn, Error = Self::Error>

Body stream written to transport

Source

type Transport: Transport<Item = Frame<Self::Out, Self::BodyOut, Self::Error>, SinkItem = Frame<Self::In, Self::BodyIn, Self::Error>>

Transport type

Required Methods§

Source

fn transport(&mut self) -> &mut Self::Transport

Mutable reference to the transport

Source

fn dispatch( &mut self, message: PipelineMessage<Self::Out, Body<Self::BodyOut, Self::Error>, Self::Error>, ) -> Result<()>

Process an out message

Source

fn poll( &mut self, ) -> Poll<Option<PipelineMessage<Self::In, Self::Stream, Self::Error>>, Error>

Poll the next completed message

Source

fn has_in_flight(&self) -> bool

RPC currently in flight TODO: Get rid of

Implementors§