ActionRegistry

Struct ActionRegistry 

Source
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

Source

pub fn from_manifest(manifest: NodeManifest) -> Self

Create registry from node manifest

Registers standard actions (IDs 0-2) and custom actions (IDs 100+).

§Arguments
  • manifest - Node manifest containing action definitions
§Returns
  • Self - Initialized action registry
Source

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 state
  • seed - Random seed for randomize action
§Returns
  • Ok(Vec<ParamUpdate>) - Parameter updates to apply
  • Err(ActionError) - Action not found or execution failed
Source

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 ID
  • ctx - Action context with current parameter state
  • seed - Random seed for randomize action
§Returns
  • Ok(Vec<ParamUpdate>) - Parameter updates to apply
  • Err(ActionError) - Invalid ID or execution failed
Source

pub fn get_id(&self, name: &str) -> Option<ActionId>

Get action ID by name (for debugging)

Source

pub fn action_count(&self) -> usize

Get action count (standard + custom)

Source

pub fn is_standard(&self, id: ActionId) -> bool

Check if action is standard (built-in)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V