pub enum TaskState {
Submitted,
Working,
InputRequired,
Completed,
Failed,
Cancelled,
}Expand description
The lifecycle state of a Task.
Legal flow:
Submitted -> Working -> InputRequired -> Working -> Completed
with Failed/Cancelled reachable from any non-terminal state.
Variants§
Submitted
Accepted into the system, not yet picked up.
Working
Actively being worked by an engine.
InputRequired
Blocked awaiting human/agent input.
Completed
Finished successfully (terminal).
Failed
Finished unsuccessfully (terminal).
Cancelled
Aborted before completion (terminal).
Implementations§
Source§impl TaskState
impl TaskState
Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
Returns true if no further transitions are legal from this state.
Sourcepub fn can_transition(from: TaskState, to: TaskState) -> bool
pub fn can_transition(from: TaskState, to: TaskState) -> bool
Pure transition predicate for the lifecycle FSM.
Terminal states have no outgoing edges. Non-terminal states may always
move to Failed or Cancelled. The happy-path edges are explicit.
Trait Implementations§
impl Copy for TaskState
Source§impl<'de> Deserialize<'de> for TaskState
impl<'de> Deserialize<'de> for TaskState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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