pub struct Signal { /* private fields */ }
Expand description
The signal type that is passed to the thread.
The thread must check the signal periodically for whether it should terminate or not. If the signal notifies the thread to stop, it should exit as fast as possible.
Implementations§
Source§impl Signal
impl Signal
Sourcepub fn should_continue(&self) -> bool
pub fn should_continue(&self) -> bool
Check whether the thread this signal was passed to is allowed to continue
Opposite of should_stop
Sourcepub fn should_stop(&self) -> bool
pub fn should_stop(&self) -> bool
Check whether the thread this signal was passed to should stop now. If this function returns true, the thread should exit as soon as possible.
Warning: Once this function returned true
, due to current limitations, it might not return
true
when called again. Once true
is returned, exit without checking the signal again.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Signal
impl RefUnwindSafe for Signal
impl Send for Signal
impl !Sync for Signal
impl Unpin for Signal
impl UnwindSafe for Signal
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