Skip to main content

RunCondition

Trait RunCondition 

Source
pub trait RunCondition: 'static {
    // Required method
    fn should_run(world: &World, resources: &Resources) -> bool;
}
Expand description

A predicate checked before a system runs. If should_run returns false, the wrapped system’s body is skipped entirely for that tick — its SystemParams are never fetched.

Re-checked every tick. This is deliberate: a resource that exists now is not guaranteed to exist forever (e.g. if something explicitly removes it later), so conditions should not assume “ready once” means “ready forever”.

Required Methods§

Source

fn should_run(world: &World, resources: &Resources) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§