pub struct TaskState {
pub id: TaskId,
pub spec: TaskSpec,
pub status: TaskStatus,
pub attempt: u32,
pub suspended_on: Option<ResumeKey>,
pub last_result: Option<Value>,
pub created_at: u64,
pub updated_at: u64,
pub spawn_depth: u32,
}Expand description
The full mutable record of one task: its static spec, current
status, attempt counter, and bookkeeping timestamps. Cloned out of
EngineState on every read (e.g. by read_task_state / poll_task).
Fields§
§id: TaskIdUnique task identifier (assigned by start_task).
spec: TaskSpecThe static spec this task was created from.
status: TaskStatusCurrent lifecycle status.
attempt: u321-based counter, bumped by Engine::dispatch_attempt_with each
time this task is dispatched.
suspended_on: Option<ResumeKey>Set while status == Suspended; the key needed to resume it.
last_result: Option<Value>Most recent result value posted via post_result or produced by a
completed attempt.
created_at: u64Unix timestamp (seconds) when the task was created.
updated_at: u64Unix timestamp (seconds) of the last state mutation.
spawn_depth: u32Recursive swarm depth. The root (an Operator calling
start_task) is 0; a child spawned by a Worker calling
start_task is its parent’s depth + 1. Exceeding
EngineCfg.max_spawn_depth raises SpawnDepthExceeded.
Implementations§
Trait Implementations§
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>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more