pub trait SystemParam {
type Item<'a>;
type State: Default + 'static;
// Required method
fn fetch<'a>(
state: &'a mut Self::State,
world: &'a World,
resources: &'a Resources,
) -> Self::Item<'a>;
}Expand description
Trait implemented for each valid system parameter type.
The macro-generated [impl_system!] blanket implementations use this to
fetch each parameter from the world and resources before calling the system
function. State is per-system storage owned by the FunctionSystem
itself (as opposed to Item, which only lives for the duration of one
call) — this is what lets Local persist between runs.
Required Associated Types§
Required Methods§
fn fetch<'a>( state: &'a mut Self::State, world: &'a World, resources: &'a Resources, ) -> Self::Item<'a>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".