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§
Sourcefn can_handle(&self, action: &Action, context: &ActionContext) -> bool
fn can_handle(&self, action: &Action, context: &ActionContext) -> bool
Check if this handler can process the given action in the current context
Sourcefn handle(
&mut self,
action: Action,
context: &ActionContext,
) -> Result<ActionResult>
fn handle( &mut self, action: Action, context: &ActionContext, ) -> Result<ActionResult>
Handle the action, returning the result