Trait shred::RunWithPool [] [src]

pub trait RunWithPool<'a> {
    fn setup(&mut self, res: &mut Resources);
fn run(&mut self, res: &'a Resources, pool: &ThreadPool);
fn reads(&self, reads: &mut Vec<ResourceId>);
fn writes(&self, writes: &mut Vec<ResourceId>); }

Similar to RunNow except additionally taking in a rayon::ThreadPool for parallelism.

Required Methods

Sets up Resources for a later call to run.

Runs the system/group of systems. Possibly in parallel depending on how the structure is set up.

Panics

Panics if the system tries to fetch resources which are borrowed in an incompatible way already (tries to read from a resource which is already written to or tries to write to a resource which is read from).

Accumulates the necessary read/shared resources from the systems in this group.

Accumulates the necessary write/exclusive resources from the systems in this group.

Implementors