dispatch

Function dispatch 

Source
pub async fn dispatch(parts: &[&str], context: &CommandContext) -> Result<()>
Expand description

Dispatches a command to the appropriate handler function.

This function takes a parsed command (parts) and the command context, then executes the corresponding command handler.

§Arguments

  • parts - A slice of strings representing the command and its arguments.
  • context - The CommandContext providing access to the application’s state.

§Returns

A Result indicating success or failure of the command execution.