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
fn get_handler_component_mut(&mut self) -> &mut HandlerComponent<Self::Sig>
fn get_handler_component_mut(&mut self) -> &mut HandlerComponent<Self::Sig>
Get a mutable reference to the event handler component.
fn get_handler_component(&self) -> &HandlerComponent<Self::Sig>
fn get_handler_component(&self) -> &HandlerComponent<Self::Sig>
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.
fn get_init_subscriptions(&self) -> Vec<Self::Sig>
fn get_init_subscriptions(&self) -> Vec<Self::Sig>
Get the initial subscriptions of the event handler.
fn set_subscriptions(&mut self, subscriptions: Vec<Self::Sig>)
fn set_subscriptions(&mut self, subscriptions: Vec<Self::Sig>)
Set the subscriptions of the event handler.