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>>;
// Required methods
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<()>;
}
Expand description
Dispatch messages from the transport to the service
Required Associated Types§
Required Methods§
Sourcefn poll(
&mut self,
) -> Poll<Option<MultiplexMessage<Self::In, Self::Stream, Self::Error>>, Error>
fn poll( &mut self, ) -> Poll<Option<MultiplexMessage<Self::In, Self::Stream, Self::Error>>, Error>
Poll the next available message
Sourcefn poll_ready(&self) -> Async<()>
fn poll_ready(&self) -> Async<()>
The Dispatch
is ready to accept another message