Skip to main content

TaskComponent

Trait TaskComponent 

Source
pub trait TaskComponent<'a>: Send + Sync {
    type Data;

    // Required method
    fn run(&mut self, data: &mut Self::Data) -> bool;
}
Expand description

An ephemeral component that needs access to Data to run some task. Will be run by run_tasks in a system with access to task_runner_query and Data.

Required Associated Types§

Required Methods§

Source

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

Returns true iff the task is complete.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§