Skip to main content

command

Macro command 

Source
macro_rules! command {
    ($key:expr => $handler:path $(,)?) => { ... };
}
Expand description

Builds a statically dispatchable command entry from a function.

The entry declares only the routing relationship. Resource requirements are inferred from Res and ResMut parameters in the function signature.

command!(0x01 => version)

The generated entry contains only the key and a monomorphized function pointer, so an array of entries can be stored in read-only memory.