pub trait Handler<Req, Resp> {
// Required methods
fn name(&self) -> &'static str;
fn run(&mut self, request: Req, world: &mut World) -> Result<Resp, String>;
fn access(&self) -> Vec<Access>;
}Expand description
Trait-object interface for all handler types.
Parallel to System, but shaped for
request/response invocation: the caller supplies a Req value and receives
Result<Resp, String> back. SystemParams are injected from the ECS world
just as they are in regular systems.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Human-readable handler name (for diagnostics and conflict messages).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".