[][src]Trait tokio_proto::streaming::multiplex::advanced::Dispatch

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<Self::BodyOut, Item = Frame<Self::Out, Self::BodyOut, Self::Error>, SinkItem = Frame<Self::In, Self::BodyIn, Self::Error>>;
    fn transport(&mut self) -> &mut Self::Transport;
fn poll(
        &mut self
    ) -> Poll<Option<MultiplexMessage<Self::In, Self::Stream, Self::Error>>, Error>;
fn poll_ready(&self) -> Async<()>;
fn dispatch(
        &mut self,
        message: MultiplexMessage<Self::Out, Body<Self::BodyOut, Self::Error>, Self::Error>
    ) -> Result<()>;
fn cancel(&mut self, request_id: RequestId) -> Result<()>; }

Dispatch messages from the transport to the service

Associated Types

type Io

Type of underlying I/O object

type In

Messages written to the transport

type BodyIn

Inbound body frame

type Out

Messages read from the transport

type BodyOut

Outbound body frame

type Error: From<Error>

Transport error

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

Inbound body stream type

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

Transport type

Loading content...

Required methods

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

Mutable reference to the transport

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

Poll the next available message

fn poll_ready(&self) -> Async<()>

The Dispatch is ready to accept another message

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

Process an out message

fn cancel(&mut self, request_id: RequestId) -> Result<()>

Cancel interest in the exchange identified by RequestId

Loading content...

Implementors

Loading content...