command_handler

Attribute Macro command_handler 

Source
#[command_handler]
Expand description

Marks a function as a Command Handler

Command handlers process commands and produce events.

§Example

#[command_handler]
async fn handle_create_user(cmd: CreateUserCommand) -> Result<Vec<Event>, String> {
    Ok(vec![Event::UserCreated { ... }])
}