[][src]Struct async_wakers::Registration

pub struct Registration { /* fields omitted */ }

A handle for updating or removing a registered Waker from a Wakers container.

This handle is returned by the register method and contains a weak reference to a Wakers (this means that, while a Registration still exists, the Wakers it is referencing could have already been destroyed; similarly, a Registration could represent a waker that has been unregistered).

Methods

impl Registration[src]

pub fn is_registered(&self) -> bool[src]

Returns whether the waker is still registered.

This method will return false if remove has been called or if Wakers unregistered the waker either because unregister or clear was called or because it was destroyed.

pub fn update(&mut self, waker: Waker) -> Option<Waker>[src]

Update the registered waker and returns the old Waker, or None if it has been notified recently (and not updated after) or if it has already been unregistered.

pub fn remove(&mut self) -> Option<Waker>[src]

Unregisters the Waker and returns it, or None if it has been notified recently (and not updated after) or if it has already been unregistered.

Trait Implementations

impl Debug for Registration[src]

impl Drop for Registration[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.