Struct DropGuard

struct DropGuard { ... }

A wrapper for cancellation token which automatically cancels it on drop. It is created using drop_guard method on the CancellationToken.

Implementations

impl DropGuard

fn disarm(self: Self) -> CancellationToken

Returns stored cancellation token and removes this drop guard instance (i.e. it will no longer cancel token). Other guards for this token are not affected.

impl Debug for DropGuard

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Drop for DropGuard

fn drop(self: &mut Self)

impl Freeze for DropGuard

impl RefUnwindSafe for DropGuard

impl Send for DropGuard

impl Sync for DropGuard

impl Unpin for DropGuard

impl UnsafeUnpin for DropGuard

impl UnwindSafe for DropGuard

impl<T> Any for DropGuard

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for DropGuard

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for DropGuard

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for DropGuard

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for DropGuard

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for DropGuard

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for DropGuard

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>