pub struct TaskSnapshot {
pub task_id: String,
pub state: CapturedTaskState,
pub retry_count: u32,
pub output: Option<String>,
}Expand description
A snapshot of a single task.
Fields§
§task_id: StringTask identifier.
state: CapturedTaskStateState at snapshot time.
retry_count: u32Number of retries that have occurred.
output: Option<String>Optional output data produced by the task.
Implementations§
Source§impl TaskSnapshot
impl TaskSnapshot
Sourcepub fn new(task_id: impl Into<String>, state: CapturedTaskState) -> Self
pub fn new(task_id: impl Into<String>, state: CapturedTaskState) -> Self
Create a new task snapshot.
Sourcepub fn with_retries(self, count: u32) -> Self
pub fn with_retries(self, count: u32) -> Self
Set retry count.
Sourcepub fn with_output(self, output: impl Into<String>) -> Self
pub fn with_output(self, output: impl Into<String>) -> Self
Set output data.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Return true if the task has finished (completed, failed, or skipped).
Trait Implementations§
Source§impl Clone for TaskSnapshot
impl Clone for TaskSnapshot
Source§fn clone(&self) -> TaskSnapshot
fn clone(&self) -> TaskSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskSnapshot
impl RefUnwindSafe for TaskSnapshot
impl Send for TaskSnapshot
impl Sync for TaskSnapshot
impl Unpin for TaskSnapshot
impl UnsafeUnpin for TaskSnapshot
impl UnwindSafe for TaskSnapshot
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