pub struct CancellationToken { /* private fields */ }Expand description
Propagates notification that operations should be canceled.
Implementations§
Source§impl CancellationToken
impl CancellationToken
Sourcepub fn can_be_canceled(&self) -> bool
pub fn can_be_canceled(&self) -> bool
Whether this token is capable of being in the canceled state.
pub fn is_cancellation_requested(&self) -> bool
Sourcepub fn register(
&self,
callback: impl FnOnce() + Send + 'static,
) -> CancellationTokenRegistration
pub fn register( &self, callback: impl FnOnce() + Send + 'static, ) -> CancellationTokenRegistration
Registers a callback that runs when the token is canceled. When the token is already canceled the callback runs immediately.
Trait Implementations§
Source§impl Clone for CancellationToken
impl Clone for CancellationToken
Auto Trait Implementations§
impl Freeze for CancellationToken
impl RefUnwindSafe for CancellationToken
impl Send for CancellationToken
impl Sync for CancellationToken
impl Unpin for CancellationToken
impl UnsafeUnpin for CancellationToken
impl UnwindSafe for CancellationToken
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more