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 Freeze for Stop
impl RefUnwindSafe for Stop
impl Send for Stop
impl Sync for Stop
impl Unpin for Stop
impl UnsafeUnpin for Stop
impl UnwindSafe for Stop
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