pub struct StopSignal { /* private fields */ }Expand description
Signal for stopping a subscription.
When the runtime stops a subscription, it sets this signal. The subscription should check it periodically and exit its run loop when set.
Implementations§
Source§impl StopSignal
impl StopSignal
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Check if the stop signal has been triggered.
Sourcepub fn wait_timeout(&self, duration: Duration) -> bool
pub fn wait_timeout(&self, duration: Duration) -> bool
Wait for either the stop signal or a timeout.
Returns true if stopped, false if timed out.
Blocks the thread efficiently using a condition variable.
Handles spurious wakeups by looping until condition met or timeout expired.
Trait Implementations§
Source§impl Clone for StopSignal
impl Clone for StopSignal
Source§fn clone(&self) -> StopSignal
fn clone(&self) -> StopSignal
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StopSignal
impl RefUnwindSafe for StopSignal
impl Send for StopSignal
impl Sync for StopSignal
impl Unpin for StopSignal
impl UnsafeUnpin for StopSignal
impl UnwindSafe for StopSignal
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