Skip to main content

RunNow

Trait RunNow 

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

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

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

Required Methods§

Source

fn run_now(&mut self, world: &'a World)

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, world: &mut World)

Sets up World for a later call to run_now.

Provided Methods§

Source

fn dispose(self: Box<Self>, world: &mut World)

Performs clean up that requires resources from the World. This commonly removes components from world which depend on external resources.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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

Source§

impl<'a, 'b> RunNow<'a> for SendDispatcher<'b>

Source§

impl<'a, P, T> RunNow<'a> for ParSeq<P, T>
where P: Borrow<ThreadPool>, T: for<'b> RunWithPool<'b>,

Source§

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