pub trait SystemData<'a> {
// Required methods
fn setup(res: &mut Resources);
fn fetch(res: &'a Resources) -> Self;
fn reads() -> Vec<ResourceId>;
fn writes() -> Vec<ResourceId>;
}Expand description
A static system data that can specify its dependencies at statically (at compile-time).
Most system data is a SystemData, the DynamicSystemData type is only needed for very special
setups.
Required Methods§
Sourcefn fetch(res: &'a Resources) -> Self
fn fetch(res: &'a Resources) -> Self
Fetches the system data from Resources. Note that this is only specified for one concrete
lifetime 'a, you need to implement the SystemData trait for every possible
lifetime.
Sourcefn reads() -> Vec<ResourceId>
fn reads() -> Vec<ResourceId>
Returns all read dependencies as fetched from Self::fetch.
Please note that returning wrong dependencies can lead to a panic.
Sourcefn writes() -> Vec<ResourceId>
fn writes() -> Vec<ResourceId>
Returns all write dependencies as fetched from Self::fetch.
Please note that returning wrong dependencies can lead to a panic.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.