Skip to main content

TaskProgressExt

Trait TaskProgressExt 

Source
pub trait TaskProgressExt {
    // Required methods
    fn progress(&self) -> Option<ProgressContext>;
    fn progress_guard(&self) -> Option<ProgressGuard>;
    fn has_progress(&self) -> bool;
}
Expand description

Task progress extension trait

Allows tasks to access progress reporting functionality during execution.

Required Methods§

Source

fn progress(&self) -> Option<ProgressContext>

Get the progress reporter for this task

Returns None if:

  • Progress tracking is not enabled
  • Called outside of task execution context
  • The context has already been cleaned up
Source

fn progress_guard(&self) -> Option<ProgressGuard>

Create a progress guard for automatic cleanup

The returned guard will automatically clear the progress context when dropped, preventing memory leaks.

Returns None if progress tracking is not enabled.

Source

fn has_progress(&self) -> bool

Check if progress reporting is available

Implementors§