Trait sc_utils::pubsub::Dispatch

source ·
pub trait Dispatch<M> {
    type Item;
    type Ret;

    fn dispatch<F>(&mut self, message: M, dispatch: F) -> Self::Ret
    where
        F: FnMut(&SeqID, Self::Item)
; }
Expand description

Dispatch a message of type M.

Required Associated Types§

The type of the that shall be sent through the channel as a result of such dispatch.

The type returned by the dispatch-method.

Required Methods§

Dispatch the message of type M.

The implementation is given an instance of M and is supposed to invoke dispatch for each matching subscriber, with an argument of type Self::Item matching that subscriber.

Note that this does not have to be of the same type with the item that will be sent through to the subscribers. The subscribers will receive a message of type Self::Item.

Implementors§