Trait armature::handler::Handler[][src]

pub trait Handler: Sender + Send + Debug {
    type Sig: IsSig<Sig = Self::Sig> + Debug;
    fn get_handler_component_mut(&mut self) -> &mut HandlerComponent<Self::Sig>;
fn get_handler_component(&self) -> &HandlerComponent<Self::Sig>; fn on_attach(&mut self) { ... }
fn on_detach(&mut self) { ... }
fn init(&mut self) { ... }
fn handle(&mut self, _event: &Self::Event) { ... }
fn get_init_subscriptions(&self) -> Vec<Self::Sig> { ... }
fn get_id(&self) -> Option<usize> { ... }
fn set_id(&mut self, id: usize) { ... }
fn set_subscriptions(&mut self, subscriptions: Vec<Self::Sig>) { ... }
fn attach(&self, sender: &mut dyn Sender<Event = Self::Event>) { ... } }

Associated Types

Required methods

Get a mutable reference to the event handler component.

Get a immutable reference to the event handler component.

Provided methods

Lifecycle method that is called when the event handler is attached to the commutator.

Lifecycle method that is called when the event handler is detached from the commutator.

Init method that is called when the commutator starts running, or if the commutator is already running right when the event handler is attached.

Handle event

Get the initial subscriptions of the event handler.

Get the id of the event handler.

Set the id of the event handler.

Set the subscriptions of the event handler.

Attach event senders to the event handler. As a result, calling post_to_self() from the event sender will send the event only to this event handler.

Implementors