pub struct DropGuardRef<'a> { /* private fields */ }Expand description
A wrapper for a borrowed CancellationToken which cancels it on drop,
created by CancellationToken::drop_guard_ref.
Implementations§
Source§impl<'a> DropGuardRef<'a>
impl<'a> DropGuardRef<'a>
Sourcepub fn token(&self) -> &CancellationToken
pub fn token(&self) -> &CancellationToken
Returns a reference to the token this guard wraps.
Sourcepub fn disarm(self) -> &'a CancellationToken
pub fn disarm(self) -> &'a CancellationToken
Returns the token and disarms this guard: it no longer cancels the token. Other guards of the same token are not affected.
Trait Implementations§
Source§impl<'a> Debug for DropGuardRef<'a>
impl<'a> Debug for DropGuardRef<'a>
Source§impl Drop for DropGuardRef<'_>
impl Drop for DropGuardRef<'_>
Auto Trait Implementations§
impl<'a> Freeze for DropGuardRef<'a>
impl<'a> RefUnwindSafe for DropGuardRef<'a>
impl<'a> Send for DropGuardRef<'a>
impl<'a> Sync for DropGuardRef<'a>
impl<'a> Unpin for DropGuardRef<'a>
impl<'a> UnsafeUnpin for DropGuardRef<'a>
impl<'a> UnwindSafe for DropGuardRef<'a>
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