/// Aborts a task by a task key.
/// The task is removed from the storage so that it can't be accessed anymore.
Aborts a task by a task key.
The task is removed from the storage so that it can't be accessed anymore.
Aborts a task by a task key . The task is removed from the storage so that it can ' t be accessed anymore .
pub fn abort_task(&mut self, task_key: usize) -> Result<(), TaskManagerError> {
        match self.tasks.try_remove(task_key) {
            Some(task_handle) => {
                task_handle.abort();
                Ok(())
            }
            None => Err(TaskManagerError::TaskNotFound),
        }
    }
pub fn abort_task ( & mut self , task_key : usize ) -> Result < ( ) , TaskManagerError > { match self . tasks . try_remove ( task_key ) { Some ( task_handle ) => { task_handle . abort ( ) ; Ok ( ( ) ) } None => Err ( TaskManagerError :: TaskNotFound ) , } }
Aborts a task by a task key.
Aborts a task by a task key .
&mut self
task_key
usize