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§
Sourcefn progress(&self) -> Option<ProgressContext>
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
Sourcefn progress_guard(&self) -> Option<ProgressGuard>
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.
Sourcefn has_progress(&self) -> bool
fn has_progress(&self) -> bool
Check if progress reporting is available