Struct context_rs::ProviderWaker
source · pub struct ProviderWaker<'a, 'b> { /* private fields */ }
Expand description
This is a Waker
compatible type that can provide
values down the async call stack implicitly.
Implementations§
source§impl<'a, 'b> ProviderWaker<'a, 'b>
impl<'a, 'b> ProviderWaker<'a, 'b>
source§impl<'a, 'b> ProviderWaker<'a, 'b>
impl<'a, 'b> ProviderWaker<'a, 'b>
sourcepub fn use_waker_with<R>(&self, f: impl for<'w> FnOnce(&'w Waker) -> R) -> R
pub fn use_waker_with<R>(&self, f: impl for<'w> FnOnce(&'w Waker) -> R) -> R
Turns &self
into a Waker
and pass it into the provided closure
Calling wake()
on this waker does wake_by_ref
only.
Calling clone()
on this waker only clones the inner waker, not the provider.
sourcepub fn from_waker_ref(waker: &Waker) -> Option<&Self>
pub fn from_waker_ref(waker: &Waker) -> Option<&Self>
Try downcast the Waker
into a ProviderWaker
Trait Implementations§
source§impl<'a, 'b> Clone for ProviderWaker<'a, 'b>
impl<'a, 'b> Clone for ProviderWaker<'a, 'b>
source§fn clone(&self) -> ProviderWaker<'a, 'b>
fn clone(&self) -> ProviderWaker<'a, 'b>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more