pub trait ActionHandler: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn invoke(
&self,
entity: &HDict,
action: &str,
args: &HDict,
) -> Result<HGrid, String>;
}Expand description
A handler for a named action that can be invoked on entities.
Implementors provide:
name()— the action name used for dispatch (e.g."reboot")invoke()— the logic that executes the action
Required Methods§
Sourcefn invoke(
&self,
entity: &HDict,
action: &str,
args: &HDict,
) -> Result<HGrid, String>
fn invoke( &self, entity: &HDict, action: &str, args: &HDict, ) -> Result<HGrid, String>
Invoke the action on the given entity with the supplied arguments.
entity— the resolved entity dict from the graphaction— the action name (same asself.name())args— additional arguments from the request grid row
Returns a result grid on success, or a human-readable error string.