OnceTask

Trait OnceTask 

Source
pub trait OnceTask: Send + Sync {
    // Required methods
    fn execute_once(self: Box<Self>, ctx: &TaskContext) -> Result<()>;
    fn name(&self) -> &str;
    fn priority(&self) -> Priority;
}
Expand description

Trait for one-time tasks that consume themselves on execution

Unlike SchedulableTask which uses &self and can be executed multiple times, OnceTask takes ownership via Box<Self> and is consumed on execution. This allows tasks to own and transfer data without wrapping in Arc/Mutex.

Required Methods§

Source

fn execute_once(self: Box<Self>, ctx: &TaskContext) -> Result<()>

Source

fn name(&self) -> &str

Source

fn priority(&self) -> Priority

Implementors§