pub struct Stop { /* private fields */ }Expand description
A cooperative stop, shared with whoever asked the loop to run.
Cloning is how the request travels: serve_until keeps one handle, the
Ctrl-C listener and the web UI keep others, and every clone points at the
same flag. There is no channel because there is nothing to send — the only
message is “stop”, it is idempotent, and a flag cannot be missed by a
receiver that was not listening yet.
A stop ends scheduler dispatch promptly. Its busy snapshot is observational: detached task workers keep their own lifetimes and ownership after this handle’s scheduler exits.
Implementations§
Source§impl Stop
impl Stop
Sourcepub fn stop(&self)
pub fn stop(&self)
Ask the loop to stop. Idempotent, and safe to call before the loop starts: the flag is checked before the first poll.
Sourcepub fn finishing(&self) -> bool
pub fn finishing(&self) -> bool
Whether a requested scheduler retirement still has an active snapshot. Workers continue independently after the scheduler has retired.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Stop
impl Freeze for Stopwhere
*const ArcInner<Atomic<bool>> is !null: Freeze,
PhantomData<ArcInner<Atomic<bool>>>: Freeze,
*const ArcInner<Atomic<usize>> is !null: Freeze,
PhantomData<ArcInner<Atomic<usize>>>: Freeze,
*const ArcInner<Notify> is !null: Freeze,
PhantomData<ArcInner<Notify>>: Freeze,
*const ArcInner<Mutex<Option<ParkCause>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Option<ParkCause>>>>: Freeze,
impl Move for Stop
impl RefUnwindSafe for Stopwhere
Atomic<usize>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Notify: RefUnwindSafe,
Mutex<Option<ParkCause>>: RefUnwindSafe,
impl Send for Stop
impl Sync for Stop
impl Unpin for Stop
impl UnsafeUnpin for Stopwhere
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,
*const ArcInner<Atomic<usize>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<usize>>>: UnsafeUnpin,
*const ArcInner<Notify> is !null: UnsafeUnpin,
PhantomData<ArcInner<Notify>>: UnsafeUnpin,
*const ArcInner<Mutex<Option<ParkCause>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<ParkCause>>>>: UnsafeUnpin,
impl UnwindSafe for Stopwhere
Arc<Atomic<bool>>: UnwindSafe,
Arc<Atomic<usize>>: UnwindSafe,
Arc<Notify>: UnwindSafe,
Arc<Mutex<Option<ParkCause>>>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more