pub struct CancellationTokenRegistration { /* private fields */ }Expand description
Represents a registered callback on a CancellationToken.
When this object is dropped before the token is cancelled, the callback is automatically removed. If the token is already cancelled, Drop does nothing.
This ensures that callbacks are only called once and resources are cleaned up.
Single-threaded only. Not safe to use concurrently.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CancellationTokenRegistration
impl !RefUnwindSafe for CancellationTokenRegistration
impl !Send for CancellationTokenRegistration
impl !Sync for CancellationTokenRegistration
impl Unpin for CancellationTokenRegistration
impl !UnwindSafe for CancellationTokenRegistration
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