Trait specs::SystemData [] [src]

pub trait SystemData<'a> {
    fn fetch(res: &'a Resources, id: usize) -> Self;
    fn reads(id: usize) -> Vec<ResourceId>;
    fn writes(id: usize) -> Vec<ResourceId>;
}

A struct implementing system data indicates that it bundles some resources which are required for the execution.

Required Methods

Creates a new resource bundle by fetching the required resources from the Resources struct.

Contract

Only fetch the resources you returned from reads / writes!

A list of [ResourceId]s the bundle needs read access to in order to build the target resource bundle.

Contract

Exactly return the dependencies you're going to fetch! Doing otherwise will cause a data race.

This method is only executed once, thus the returned value may never change (otherwise it has no effect).

A list of [ResourceId]s the bundle needs write access to in order to build the target resource bundle.

Contract

Exactly return the dependencies you're going to fetch! Doing otherwise will cause a data race.

This method is only executed once, thus the returned value may never change (otherwise it has no effect).

Implementors