pub trait DynamicSystemData<'a> {
type Accessor: Accessor;
// Required methods
fn setup(accessor: &Self::Accessor, res: &mut Resources);
fn fetch(access: &Self::Accessor, res: &'a Resources) -> Self;
}Expand description
A struct implementing system data indicates that it bundles some resources which are required for the execution.
This is the more flexible, but complex variant of SystemData.
Required Associated Types§
Required Methods§
Sourcefn setup(accessor: &Self::Accessor, res: &mut Resources)
fn setup(accessor: &Self::Accessor, res: &mut Resources)
Sets up Resources for fetching this system data.
Sourcefn fetch(access: &Self::Accessor, res: &'a Resources) -> Self
fn fetch(access: &Self::Accessor, res: &'a Resources) -> Self
Creates a new resource bundle
by fetching the required resources
from the Resources struct.
§Contract
Only fetch the resources you returned from reads / writes!
§Panics
This function may panic if the above contract is violated.
This function may panic if the resource doesn’t exist. This is only the case if either
setup was not called or it didn’t insert any fallback value.
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.