Trait tokio_tower::multiplex::client::TagStore [−][src]
pub trait TagStore<Request, Response> {
type Tag: Eq;
fn assign_tag(self: Pin<&mut Self>, r: &mut Request) -> Self::Tag;
fn finish_tag(self: Pin<&mut Self>, r: &Response) -> Self::Tag;
}
Expand description
A transport capable of transporting tagged requests and responses must implement this
interface in order to be used with a Client
.
Note that we require self to be pinned here as assign_tag
and finish_tag
are called on the
transport, which is already pinned so that we can use it as a Stream + Sink
. It wouldn’t be
safe to then give out &mut
to the transport without Pin
, as that might move the transport.
Associated Types
Required methods
Assign a fresh tag to the given Request
, and return that tag.