pub struct Tracker { /* private fields */ }Expand description
Registry of every pid a run started, so the run can assert nothing leaked.
Implementations§
Source§impl Tracker
impl Tracker
pub fn new() -> Self
pub fn register(&self, pid: u32, label: &str)
pub fn forget(&self, pid: u32)
pub fn alive(&self) -> Vec<(u32, String)>
pub fn pids(&self) -> Vec<u32>
pub fn kill_all(&self)
Sourcepub fn assert_no_orphans(&self) -> Result<()>
pub fn assert_no_orphans(&self) -> Result<()>
Fail when any tracked process survived; survivors are killed first so a failing assertion never leaves its own litter.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tracker
impl RefUnwindSafe for Tracker
impl Send for Tracker
impl Sync for Tracker
impl Unpin for Tracker
impl UnsafeUnpin for Tracker
impl UnwindSafe for Tracker
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