[][src]Trait specs_task::TaskComponent

pub trait TaskComponent<'a>: Component {
    type Data: SystemData<'a>;
    fn run(&mut self, data: &mut Self::Data) -> bool;
}

An ephemeral component that needs access to SystemData to run some task. Will be run by the TaskRunnerSystem<T> until run returns true.

Note: TaskComponent::Data isn't allowed to contain Storage<TaskComponent>, since the TaskRunnerSystem already uses that resource and borrows it mutably while calling TaskComponent::run.

Associated Types

type Data: SystemData<'a>

Loading content...

Required methods

fn run(&mut self, data: &mut Self::Data) -> bool

Returns true iff the task is complete.

Loading content...

Implementors

Loading content...