struct WrappedWaker {
    inner_waker: UnsafeCell<Option<Waker>>,
    poll_state: SharedPollState,
    need_to_poll: u8,
}
Expand description

Will update state with the provided value on wake_by_ref call and then, if there is a need, call inner_waker.

Fields§

§inner_waker: UnsafeCell<Option<Waker>>§poll_state: SharedPollState§need_to_poll: u8

Implementations§

source§

impl WrappedWaker

source

unsafe fn replace_waker(self_arc: &mut Arc<Self>, cx: &Context<'_>)

Replaces given waker’s inner_waker for polling stream/futures which will update poll state on wake_by_ref call. Use only if you need several contexts.

Safety

This function will modify waker’s inner_waker via UnsafeCell, so it should be used only during POLLING phase by one thread at the time.

source

fn start_waking( &self ) -> Option<(u8, PollStateBomb<'_, impl FnOnce(&SharedPollState) -> u8>)>

Attempts to start the waking process for the waker with the given value. If succeeded, then the stream isn’t yet woken and not being polled at the moment.

Trait Implementations§

source§

impl ArcWake for WrappedWaker

source§

fn wake_by_ref(self_arc: &Arc<Self>)

Indicates that the associated task is ready to make progress and should be polled. Read more
source§

fn wake(self: Arc<Self, Global>)

Indicates that the associated task is ready to make progress and should be polled. Read more
source§

impl Send for WrappedWaker

source§

impl Sync for WrappedWaker

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.