pub struct ExitWatch(/* private fields */);Expand description
Sleeps until a child exits, its Bell rings or a deadline passes.
Implementations§
Source§impl ExitWatch
impl ExitWatch
Sourcepub fn new(child: &Child) -> (Self, Bell)
pub fn new(child: &Child) -> (Self, Bell)
Watches child, and returns the bell that wakes Self::wait. child must
not have been waited for yet: once reaped, its process id can name another
process.
Sourcepub fn wait(&self, deadline: Option<Duration>)
pub fn wait(&self, deadline: Option<Duration>)
Sleeps until the child exits, the bell rings or deadline (from now) passes;
None waits without a deadline. It never reaps the child.
Sourcepub fn watches_the_process(&self) -> bool
pub fn watches_the_process(&self) -> bool
Whether the system lets this watch sleep until the child exits, rather than returning every 100 ms.
Auto Trait Implementations§
impl Forget for ExitWatch
impl Freeze for ExitWatch
impl Move for ExitWatch
impl RefUnwindSafe for ExitWatch
impl Send for ExitWatch
impl Sync for ExitWatch
impl Unpin for ExitWatch
impl UnsafeUnpin for ExitWatch
impl UnwindSafe for ExitWatch
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