pub trait CommandHandler<C: Command, R: Serialize>: Send + Sync {
// Required method
fn handle(&self, cmd: C) -> Result<R, String>;
}Expand description
Handler for a command type. Game project implements this.
C is the command type (e.g., SpawnUnit).
R is the response type (e.g., () or a result DTO).
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".