Struct armature::commutator::Commutator[][src]

pub struct Commutator<E, S> where
    E: IsEvent<Event = E, Sig = S>,
    S: IsSig<Sig = S>, 
{ pub handlers: HashMap<usize, Box<dyn Handler<Event = E, Sig = S>>>, pub event_map: HashMap<S, HashSet<usize>>, // some fields omitted }
Expand description

The commutator dispatches events to the stators attached to it.

Fields

handlers: HashMap<usize, Box<dyn Handler<Event = E, Sig = S>>>event_map: HashMap<S, HashSet<usize>>

Implementations

Attach an event handler to the commutator

Detach an event handler from the commutator.

Get a mutable reference to an event handler.

Publish an event to all handlers.

Drain all the events that are currently in the receiver.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.