pub struct StatementCancellationScope { /* private fields */ }Expand description
Runs the current thread under one statement’s cancellation until it drops, restoring the enclosing statement’s so nested statements and workers return to their caller’s.
Implementations§
Source§impl StatementCancellationScope
impl StatementCancellationScope
Sourcepub fn enter(token: impl Into<Option<CancellationToken>>) -> Self
pub fn enter(token: impl Into<Option<CancellationToken>>) -> Self
Enter token as the running statement’s cancellation. Entering None runs the thread outside any statement, as a worker does for work dispatched from outside one, so it never observes the cancellation of a statement whose work it ran before.
Trait Implementations§
Source§impl Drop for StatementCancellationScope
impl Drop for StatementCancellationScope
Auto Trait Implementations§
impl !Send for StatementCancellationScope
impl !Sync for StatementCancellationScope
impl Freeze for StatementCancellationScope
impl RefUnwindSafe for StatementCancellationScope
impl Unpin for StatementCancellationScope
impl UnsafeUnpin for StatementCancellationScope
impl UnwindSafe for StatementCancellationScope
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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