pub struct CancelToken(/* private fields */);Implementations§
Source§impl CancelToken
impl CancelToken
pub fn is_cancelled(&self) -> bool
Sourcepub fn register_cancel_resource(
&self,
resource: impl FnOnce() -> Result<(), Failure> + Send + 'static,
) -> Result<(), Failure>
pub fn register_cancel_resource( &self, resource: impl FnOnce() -> Result<(), Failure> + Send + 'static, ) -> Result<(), Failure>
Install the single optional resource hook before acquiring native resources. A late installation executes immediately and returns its failure to the installer. Hooks must be prompt: they must not join or wait for workers. A resource published after cancellation must also be revoked by its owner.
Sourcepub fn clear_cancel_resource(&self)
pub fn clear_cancel_resource(&self)
Call only after normal resource cleanup. An already detached callback may still run; the resource itself must serialize revocation and reuse.
Trait Implementations§
Source§impl Clone for CancelToken
impl Clone for CancelToken
Source§fn clone(&self) -> CancelToken
fn clone(&self) -> CancelToken
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for CancelToken
impl !UnwindSafe for CancelToken
impl Freeze for CancelToken
impl Send for CancelToken
impl Sync for CancelToken
impl Unpin for CancelToken
impl UnsafeUnpin for CancelToken
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