pub struct TaskProgress { /* private fields */ }Expand description
Non-clone task-local progress handle.
Dropping a running handle without calling TaskProgress::complete or
TaskProgress::fail marks the task failed, making ordinary ? returns
safe without a separate cleanup branch.
Implementations§
Source§impl TaskProgress
impl TaskProgress
Sourcepub fn identity(&self) -> &TaskIdentity
pub fn identity(&self) -> &TaskIdentity
Borrows the exact parameter-derived task identity.
Sourcepub fn current_iteration(&self) -> u64
pub fn current_iteration(&self) -> u64
Returns the latest reported absolute simulation iteration.
Sourcepub fn target_iteration(&self) -> Option<u64>
pub fn target_iteration(&self) -> Option<u64>
Returns the known absolute target iteration, if one exists.
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
Returns this task’s current lifecycle status.
Sourcepub fn set_iteration(&self, iteration: u64) -> Result<(), ReportingError>
pub fn set_iteration(&self, iteration: u64) -> Result<(), ReportingError>
Synchronizes progress to an authoritative absolute simulation iteration.
The atomic update never allocates or locks. Regressions and movement beyond a known target are rejected without modifying the counter.
Sourcepub fn should_continue(&self, iteration: u64) -> Result<bool, ReportingError>
pub fn should_continue(&self, iteration: u64) -> Result<bool, ReportingError>
Synchronizes the authoritative iteration and applies the configured continuation target.
An indeterminate task returns true. A task with a target returns
true below it and false exactly at it. Movement beyond the target or
backwards is rejected through the same validation as Self::set_iteration.
Sourcepub fn set_phase(&self, phase: impl Into<String>)
pub fn set_phase(&self, phase: impl Into<String>)
Updates one infrequent human-readable phase such as evolving or
validating. Phase updates may lock; iteration updates do not.
Sourcepub fn report(&self, message: impl Into<String>) -> Result<(), ReportingError>
pub fn report(&self, message: impl Into<String>) -> Result<(), ReportingError>
Sends one task-scoped message through the sole renderer.
Sourcepub fn complete(self, reason: Option<String>) -> Result<(), ReportingError>
pub fn complete(self, reason: Option<String>) -> Result<(), ReportingError>
Marks the complete task workflow successful and consumes this handle.
reason == None means the configured target must have been reached.
Some(reason) records an intentional scientific early-completion reason
and permits completion before that generic target.