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