cooked_waker

Trait WakeRef

Source
pub trait WakeRef {
    // Required method
    fn wake_by_ref(&self);
}
Expand description

Wakers that can wake by reference. This trait is used to enable a Wake implementation for types that don’t own an underlying handle, like Arc<T> and &T.

This trait is implemented for most container and reference types, like &T where T: WakeRef, Box<T: WakeRef>, and Arc<T: WakeRef>.

Required Methods§

Source

fn wake_by_ref(&self)

Wake up the task by reference. In general Wake::wake should be preferred, if available, as it’s probably more efficient.

A Waker created by IntoWaker will call this method through Waker::wake_by_ref.

Implementations on Foreign Types§

Source§

impl WakeRef for Waker

Source§

impl<T: WakeRef + ?Sized> WakeRef for &T

Source§

impl<T: WakeRef + ?Sized> WakeRef for Box<T>

Source§

impl<T: WakeRef + ?Sized> WakeRef for Rc<T>

Source§

impl<T: WakeRef + ?Sized> WakeRef for Weak<T>

Source§

impl<T: WakeRef + ?Sized> WakeRef for Arc<T>

Source§

impl<T: WakeRef + ?Sized> WakeRef for Weak<T>

Source§

impl<T: WakeRef> WakeRef for Option<T>

Implementors§