Struct tap::task_scheduler::TaskScheduler
source · [−]pub struct TaskScheduler { /* private fields */ }
Implementations
sourceimpl TaskScheduler
impl TaskScheduler
Provide different method to run, schedule and create new task.
sourcepub fn schedule(
&self,
plugin: Box<dyn PluginInstance + Sync + Send>,
argument: PluginArgument,
relaunch: bool
) -> Result<TaskId, Error>
pub fn schedule(
&self,
plugin: Box<dyn PluginInstance + Sync + Send>,
argument: PluginArgument,
relaunch: bool
) -> Result<TaskId, Error>
Create a new task and schedule it to be launched, return a task id or an error if task already exist.
sourcepub fn run(
&self,
plugin: Box<dyn PluginInstance + Sync + Send>,
argument: PluginArgument,
relaunch: bool
) -> Result<PluginResult, Arc<Error>>
pub fn run(
&self,
plugin: Box<dyn PluginInstance + Sync + Send>,
argument: PluginArgument,
relaunch: bool
) -> Result<PluginResult, Arc<Error>>
Create a new task and block until the task is finished, return a plugin result or an error, if task exist or if execution of the task failed.
sourcepub fn tasks_are_finished(&self) -> bool
pub fn tasks_are_finished(&self) -> bool
sourcepub fn task(&self, id: TaskId) -> Option<TaskState>
pub fn task(&self, id: TaskId) -> Option<TaskState>
Return a TaskState corresponding to a task id.
sourcepub fn tasks(&self, ids: Vec<TaskId>) -> Vec<TaskState>
pub fn tasks(&self, ids: Vec<TaskId>) -> Vec<TaskState>
Return a vec of TaskState for corresponding task id.
sourcepub fn to_vec(&self) -> Vec<TaskState>
pub fn to_vec(&self) -> Vec<TaskState>
Return a copy of all the task state for all task in the tasks
map.
sourcepub fn task_count(&self) -> u32
pub fn task_count(&self) -> u32
sourcepub fn tasks_finished(&self) -> Vec<(Task, TaskResult)>
pub fn tasks_finished(&self) -> Vec<(Task, TaskResult)>
Auto Trait Implementations
impl RefUnwindSafe for TaskScheduler
impl Send for TaskScheduler
impl Sync for TaskScheduler
impl Unpin for TaskScheduler
impl UnwindSafe for TaskScheduler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more