pub enum TaskState {
Created,
Queued,
Running {
worker_id: usize,
},
Suspended {
waiting_on: Vec<TaskId>,
},
Completed {
result: RtObject,
},
Failed {
error: String,
},
Cancelled,
}Expand description
The state of a task in its lifecycle.
Variants§
Created
Task has been created but not yet scheduled.
Queued
Task is in a queue waiting to be executed.
Running
Task is currently running on a worker.
Suspended
Task is suspended (waiting for a dependency).
Completed
Task has completed successfully.
Failed
Task has failed with an error.
Cancelled
Task has been cancelled.
Implementations§
Source§impl TaskState
impl TaskState
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if the task is in a terminal state.
Sourcepub fn is_runnable(&self) -> bool
pub fn is_runnable(&self) -> bool
Check if the task is runnable.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the task is running.
Sourcepub fn is_suspended(&self) -> bool
pub fn is_suspended(&self) -> bool
Check if the task is suspended.
Trait Implementations§
impl Eq for TaskState
impl StructuralPartialEq for TaskState
Auto Trait Implementations§
impl Freeze for TaskState
impl RefUnwindSafe for TaskState
impl Send for TaskState
impl Sync for TaskState
impl Unpin for TaskState
impl UnsafeUnpin for TaskState
impl UnwindSafe for TaskState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more