pub struct Stop { /* private fields */ }Expand description
A request to stop between units of work, shared by every clone: an update checks it before each batch of diffs and finishes the batch it has begun, so the database and its files stay consistent.
It stops on a time limit, on request from any thread, and, with the signals feature, on
Ctrl+C, SIGTERM and SIGHUP. A default Stop never asks.
Implementations§
Source§impl Stop
impl Stop
Sourcepub fn with_max_runtime(self, runtime: Duration) -> Self
pub fn with_max_runtime(self, runtime: Duration) -> Self
Asks to stop once runtime has passed, counted from now. A runtime too long to represent is no limit.
Sourcepub fn reason(&self) -> Option<StopReason>
pub fn reason(&self) -> Option<StopReason>
Why to stop now, if it was requested or the time limit has passed; a request is reported first.
Sourcepub fn wait(&self, duration: Duration) -> Option<StopReason>
pub fn wait(&self, duration: Duration) -> Option<StopReason>
Sleeps for duration, or less if a stop is asked for in the meantime, and returns the reason it woke early.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Stop
impl Freeze for Stop
impl Move 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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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