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::Ret
fn dispatch<F>(&mut self, message: M, dispatch: F) -> Self::Ret
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
.
Object Safety§
This trait is not object safe.