pub trait Dispatch<M> {
type Item;
type Ret;
// Required method
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§
Required Methods§
sourcefn dispatch<F>(&mut self, message: M, dispatch: F) -> Self::Retwhere
F: FnMut(&SeqID, Self::Item),
fn dispatch<F>(&mut self, message: M, dispatch: F) -> Self::Retwhere F: FnMut(&SeqID, Self::Item),
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
.