[][src]Trait shred::System

pub trait System<'a> {
    type SystemData: DynamicSystemData<'a>;
    fn run(&mut self, data: Self::SystemData);

    fn running_time(&self) -> RunningTime { ... }
fn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self> { ... }
fn setup(&mut self, world: &mut World) { ... }
fn dispose(self, world: &mut World)
    where
        Self: Sized
, { ... } }

A System, executed with a set of required Resources.

Associated Types

type SystemData: DynamicSystemData<'a>

The resource bundle required to execute this system.

You will mostly use a tuple of system data (which also implements SystemData). You can also create such a resource bundle by simply deriving SystemData for a struct.

Every SystemData is also a DynamicSystemData.

Loading content...

Required methods

fn run(&mut self, data: Self::SystemData)

Executes the system with the required system data.

Loading content...

Provided methods

fn running_time(&self) -> RunningTime

Returns a hint how long the system needs for running. This is used to optimize the way they're executed (might allow more parallelization).

Defaults to RunningTime::Average.

fn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self>

Return the accessor from the [SystemData].

fn setup(&mut self, world: &mut World)

Sets up the World using Self::SystemData::setup.

fn dispose(self, world: &mut World) where
    Self: Sized

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

Loading content...

Implementors

impl<'a, '_, '_> System<'a> for DefaultBatchControllerSystem<'_, '_>[src]

type SystemData = BatchUncheckedWorld<'a>

Loading content...