pub struct TaskTracker { /* private fields */ }Expand description
Tracks active tasks for deadlock detection.
Thread-safe — all methods take &self. Typically stored in a static
or shared via Arc.
Implementations§
Source§impl TaskTracker
impl TaskTracker
Sourcepub fn track(&self, description: &str) -> TaskGuard<'_>
pub fn track(&self, description: &str) -> TaskGuard<'_>
Start tracking a task. Returns a guard that removes the task when dropped.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Number of currently active tasks.
Sourcepub fn completed_count(&self) -> u64
pub fn completed_count(&self) -> u64
Total number of completed tasks since creation.
Sourcepub fn check_stuck_tasks(&self, max_duration: Duration) -> Vec<StuckTaskInfo>
pub fn check_stuck_tasks(&self, max_duration: Duration) -> Vec<StuckTaskInfo>
Find tasks running longer than max_duration.
Sourcepub fn dump_all_tasks(&self) -> String
pub fn dump_all_tasks(&self) -> String
Dump all active tasks as a formatted string for diagnostics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaskTracker
impl !RefUnwindSafe for TaskTracker
impl Send for TaskTracker
impl Sync for TaskTracker
impl Unpin for TaskTracker
impl UnsafeUnpin for TaskTracker
impl UnwindSafe for TaskTracker
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