pub trait System: 'static {
// Required method
fn run(&mut self, world: &World, resources: &Resources);
// Provided methods
fn name(&self) -> &'static str { ... }
fn ordering_id(&self) -> TypeId { ... }
fn after_ids(&self) -> &[TypeId] { ... }
fn before_ids(&self) -> &[TypeId] { ... }
}Expand description
A type-erased, executable system.
Required Methods§
Provided Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Human-readable identifier for this system, used in error/trace output.
Defaults to the type name of the System impl; FunctionSystem
overrides this with the name of the wrapped function/closure.
Sourcefn ordering_id(&self) -> TypeId
fn ordering_id(&self) -> TypeId
This system’s identity for ordering purposes — the TypeId
of the function/closure it wraps. Automatic: every distinct function
or closure has a distinct type, so no manual labeling is needed to
make a system a valid target for another system’s
after/before.
Defaults to Self’s own TypeId; FunctionSystem/OnceFunctionSystem
override it with the wrapped function’s TypeId instead of the
wrapper’s, so ordering constraints referencing the bare function match.
Sourcefn after_ids(&self) -> &[TypeId]
fn after_ids(&self) -> &[TypeId]
Other systems in the same stage that must run before this one. Set
via SystemOrderingExt::after. A referenced system that isn’t
registered in the same stage is silently ignored.
Sourcefn before_ids(&self) -> &[TypeId]
fn before_ids(&self) -> &[TypeId]
Other systems in the same stage that must run after this one. Set
via SystemOrderingExt::before. A referenced system that isn’t
registered in the same stage is silently ignored.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".