Trait RunNow

Source
pub trait RunNow<'a> {
    // Required methods
    fn run_now(&mut self, res: &'a Resources);
    fn setup(&mut self, res: &mut Resources);

    // Provided method
    fn dispose(self: Box<Self>, res: &mut Resources) { ... }
}
Expand description

Trait for fetching data and running systems. Automatically implemented for systems.

Required Methods§

Source

fn run_now(&mut self, res: &'a Resources)

Runs the system now.

§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).

Source

fn setup(&mut self, res: &mut Resources)

Sets up Resources for a later call to run_now.

Provided Methods§

Source

fn dispose(self: Box<Self>, res: &mut Resources)

Performs clean up that requires resources from the Resources.

This commonly removes components from Resources which depend on external resources.

Implementors§

Source§

impl<'a, 'b, 'c> RunNow<'a> for Dispatcher<'b, 'c>

Source§

impl<'a, T> RunNow<'a> for T
where T: System<'a>,