Skip to main content

system

Attribute Macro system 

Source
#[system]
Expand description

Attach perf-aware metadata to a fn(&mut World).

Generates a sibling module sharing the fn’s ident exposing system() returning a [mirui::ecs::System] with the configured name + run_order slot. The fn itself is left intact so direct calls (tests, manual invocation) still work.

#[mirui::system(order = ANIMATION)]
fn spin_system(world: &mut World) { /* ... */ }

spin_system(world);                     // direct call
app.add_system(spin_system::system());  // scheduled

Defaults: name derives from the fn ident; order defaults to run_order::NORMAL. order accepts either a run_order::* constant or a literal i32.