Struct futures_util::stream::stream::flatten_unordered::WrappedWaker
source · 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
impl WrappedWaker
sourceunsafe fn replace_waker(self_arc: &mut Arc<Self>, cx: &Context<'_>)
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.
sourcefn start_waking(
&self
) -> Option<(u8, PollStateBomb<'_, impl FnOnce(&SharedPollState) -> u8>)>
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
impl ArcWake for WrappedWaker
impl Send for WrappedWaker
impl Sync for WrappedWaker
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more