pub struct CommandExecutor<R, S> { /* private fields */ }Expand description
Command executor for synchronous commands.
Note: Task commands require async execution and return ExecutionResult::Pending.
Implementations§
Source§impl<R: Router, S: Storage> CommandExecutor<R, S>
impl<R: Router, S: Storage> CommandExecutor<R, S>
Sourcepub const fn new(config: ExecutorConfig<R, S>) -> Self
pub const fn new(config: ExecutorConfig<R, S>) -> Self
Create a new command executor.
Sourcepub fn execute<M: Send>(&self, command: Command<M>) -> ExecutionResult<M>
pub fn execute<M: Send>(&self, command: Command<M>) -> ExecutionResult<M>
Execute a command synchronously.
For async Task commands, this returns ExecutionResult::Pending.
Use execute_blocking to block on async tasks.