Skip to main content

apply_action

Function apply_action 

Source
pub fn apply_action(
    app: &mut App,
    action: Action,
    _command_tx: &Sender<Command>,
) -> Option<Command>
Expand description

Apply an action to the application state.

This function handles both UI-only actions (which modify app state directly) and command actions (which return a command to be sent to the background worker).

§Arguments

  • app - Mutable reference to the application state
  • action - The action to apply
  • _command_tx - Channel for sending commands (used for reference, actual sending done by caller)

§Returns

Some(Command) if an async command should be sent to the background worker, None if the action was handled entirely within the UI.