Struct cocaine::dispatch::PrimitiveDispatch
[−]
[src]
pub struct PrimitiveDispatch<T> { /* fields omitted */ }
A single-shot dispatch wraps the given oneshot sender and implements Primitive
protocol
emitting either value or error.
The majority of services adheres such protocol.
Methods
impl<T> PrimitiveDispatch<T>
[src]
fn new(tx: Sender<Result<T, Error>>) -> Self
[src]
Constructs a PrimitiveDispatch
by wrapping the specified oneshot sender.
fn pair() -> (Self, impl Future<Item = T, Error = Error>)
[src]
Constructs a PrimitiveDispatch
paired with a future of result.
The future returned will be resolved at a time when an incoming message is consumed by the dispatch.