ActionHandler

Trait ActionHandler 

Source
pub trait ActionHandler {
    // Required methods
    fn can_handle(&self, action: &Action, context: &ActionContext) -> bool;
    fn handle(
        &mut self,
        action: Action,
        context: &ActionContext,
    ) -> Result<ActionResult>;
}
Expand description

Trait for components that can handle actions

Required Methods§

Source

fn can_handle(&self, action: &Action, context: &ActionContext) -> bool

Check if this handler can process the given action in the current context

Source

fn handle( &mut self, action: Action, context: &ActionContext, ) -> Result<ActionResult>

Handle the action, returning the result

Implementors§