pub struct GenerationControlHandle { /* private fields */ }Expand description
Thread-safe requests for a worker whose native session can remain thread-affine. Pausing is sticky until the owning worker explicitly resumes. Cancellation retains the ordinary permanent cancellation-token semantics.
Implementations§
Source§impl GenerationControlHandle
impl GenerationControlHandle
Sourcepub fn new(cancellation: GenerationCancellationToken) -> Self
pub fn new(cancellation: GenerationCancellationToken) -> Self
Creates a handle using the ordinary caller’s cancellation token.
Sourcepub fn request_pause(&self)
pub fn request_pause(&self)
Requests pause at the next successful completed-token boundary.
Sourcepub fn pause_requested(&self) -> bool
pub fn pause_requested(&self) -> bool
Whether a pause request is pending. This does not itself prove completion.
Sourcepub fn acknowledge_resume(&self)
pub fn acknowledge_resume(&self)
Acknowledges an explicit resume before checking for a new pause request.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Permanently cancels this run, without reinterpreting cancellation as pause.
Sourcepub fn cancellation(&self) -> &GenerationCancellationToken
pub fn cancellation(&self) -> &GenerationCancellationToken
Ordinary cancellation token, shared with existing generation consumers.
Trait Implementations§
Source§impl Clone for GenerationControlHandle
impl Clone for GenerationControlHandle
Source§fn clone(&self) -> GenerationControlHandle
fn clone(&self) -> GenerationControlHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenerationControlHandle
impl Debug for GenerationControlHandle
Source§impl Default for GenerationControlHandle
impl Default for GenerationControlHandle
Source§fn default() -> GenerationControlHandle
fn default() -> GenerationControlHandle
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GenerationControlHandle
impl RefUnwindSafe for GenerationControlHandle
impl Send for GenerationControlHandle
impl Sync for GenerationControlHandle
impl Unpin for GenerationControlHandle
impl UnsafeUnpin for GenerationControlHandle
impl UnwindSafe for GenerationControlHandle
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