pub struct ActionRegistry { /* private fields */ }Expand description
Action registry for a node
Maintains bidirectional mapping between action names and IDs, and dispatches to appropriate handlers.
Implementations§
Source§impl ActionRegistry
impl ActionRegistry
Sourcepub fn from_manifest(manifest: NodeManifest) -> Self
pub fn from_manifest(manifest: NodeManifest) -> Self
Sourcepub fn trigger(
&self,
name: &str,
ctx: &ActionContext<'_>,
seed: u64,
) -> Result<Vec<ParamUpdate>, ActionError>
pub fn trigger( &self, name: &str, ctx: &ActionContext<'_>, seed: u64, ) -> Result<Vec<ParamUpdate>, ActionError>
Trigger action by name (UI path)
Looks up action ID by name and dispatches.
§Arguments
name- Action name (e.g., “reset”, “randomize”)ctx- Action context with current parameter stateseed- Random seed for randomize action
§Returns
Ok(Vec<ParamUpdate>)- Parameter updates to applyErr(ActionError)- Action not found or execution failed
Sourcepub fn execute(
&self,
id: ActionId,
ctx: &ActionContext<'_>,
seed: u64,
) -> Result<Vec<ParamUpdate>, ActionError>
pub fn execute( &self, id: ActionId, ctx: &ActionContext<'_>, seed: u64, ) -> Result<Vec<ParamUpdate>, ActionError>
Execute action by numeric ID (fast path)
Directly dispatches to handler without name lookup.
§Arguments
id- Numeric action IDctx- Action context with current parameter stateseed- Random seed for randomize action
§Returns
Ok(Vec<ParamUpdate>)- Parameter updates to applyErr(ActionError)- Invalid ID or execution failed
Sourcepub fn action_count(&self) -> usize
pub fn action_count(&self) -> usize
Get action count (standard + custom)
Sourcepub fn is_standard(&self, id: ActionId) -> bool
pub fn is_standard(&self, id: ActionId) -> bool
Check if action is standard (built-in)
Auto Trait Implementations§
impl Freeze for ActionRegistry
impl RefUnwindSafe for ActionRegistry
impl Send for ActionRegistry
impl Sync for ActionRegistry
impl Unpin for ActionRegistry
impl UnwindSafe for ActionRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more