Skip to main content

TaskProgress

Struct TaskProgress 

Source
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

Source

pub fn identity(&self) -> &TaskIdentity

Borrows the exact parameter-derived task identity.

Source

pub fn current_iteration(&self) -> u64

Returns the latest reported absolute simulation iteration.

Source

pub fn target_iteration(&self) -> Option<u64>

Returns the known absolute target iteration, if one exists.

Source

pub fn status(&self) -> TaskStatus

Returns this task’s current lifecycle status.

Source

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.

Source

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.

Source

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.

Source

pub fn report(&self, message: impl Into<String>) -> Result<(), ReportingError>

Sends one task-scoped message through the sole renderer.

Source

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.

Source

pub fn fail(self, reason: impl Into<String>)

Marks the task failed, records a concise phase, and consumes the handle.

Trait Implementations§

Source§

impl Debug for TaskProgress

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for TaskProgress

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.