pub enum TaskState {
Ready,
Running,
Blocked,
Suspended,
Done(TerminationReason),
}Expand description
Schedulability of a task — orthogonal to the intra-turn step
(Reason/Act/Observe/Delta), which stays on crate::scheduler::state_machine::LoopPhase.
Unifies LoopPhase::{Idle,Suspended,Blocked,Terminal} and
[ProcessState::{Running,Joined,Failed}].
Variants§
Ready
Eligible to run, not yet picked by the scheduler (LoopPhase::Idle).
Running
Currently executing a turn (LoopPhase::{Reason,Act,Observe,Delta} / ProcessState::Running).
Blocked
Blocked awaiting an in-flight continuation (tool suspend / milestone eval).
Suspended
Suspended awaiting external resolution (human approval / sub-agent join / external).
Done(TerminationReason)
Finished. Carries the termination reason (ProcessState::{Joined,Failed} + LoopPhase::Terminal).
Implementations§
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
Source§impl From<ProcessState> for TaskState
A successful join maps to Done(Completed); any other termination is Done(<reason>).
impl From<ProcessState> for TaskState
A successful join maps to Done(Completed); any other termination is Done(<reason>).
Source§fn from(state: ProcessState) -> Self
fn from(state: ProcessState) -> Self
Converts to this type from the input type.
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