Struct futures_util::stream::futures_unordered::task::Task
source · pub(super) struct Task<Fut> {
pub(super) future: UnsafeCell<Option<Fut>>,
pub(super) next_all: AtomicPtr<Task<Fut>>,
pub(super) prev_all: UnsafeCell<*const Task<Fut>>,
pub(super) len_all: UnsafeCell<usize>,
pub(super) next_ready_to_run: AtomicPtr<Task<Fut>>,
pub(super) ready_to_run_queue: Weak<ReadyToRunQueue<Fut>>,
pub(super) queued: AtomicBool,
pub(super) woken: AtomicBool,
}
Fields§
§future: UnsafeCell<Option<Fut>>
§next_all: AtomicPtr<Task<Fut>>
§prev_all: UnsafeCell<*const Task<Fut>>
§len_all: UnsafeCell<usize>
§next_ready_to_run: AtomicPtr<Task<Fut>>
§ready_to_run_queue: Weak<ReadyToRunQueue<Fut>>
§queued: AtomicBool
§woken: AtomicBool
Implementations§
source§impl<Fut> Task<Fut>
impl<Fut> Task<Fut>
sourcepub(super) unsafe fn waker_ref(this: &Arc<Self>) -> WakerRef<'_>
pub(super) unsafe fn waker_ref(this: &Arc<Self>) -> WakerRef<'_>
Returns a waker reference for this task without cloning the Arc.
sourcepub(super) fn spin_next_all(
&self,
pending_next_all: *mut Self,
ordering: Ordering,
) -> *const Self
pub(super) fn spin_next_all( &self, pending_next_all: *mut Self, ordering: Ordering, ) -> *const Self
Spins until next_all
is no longer set to pending_next_all
.
The temporary pending_next_all
value is typically overwritten fairly
quickly after a node is inserted into the list of all futures, so this
should rarely spin much.
When it returns, the correct next_all
value is returned.
Relaxed
or Acquire
ordering can be used. Acquire
ordering must be
used before len_all
can be safely read.
Trait Implementations§
impl<Fut> Send for Task<Fut>
impl<Fut> Sync for Task<Fut>
Auto Trait Implementations§
impl<Fut> !Freeze for Task<Fut>
impl<Fut> !RefUnwindSafe for Task<Fut>
impl<Fut> Unpin for Task<Fut>where
Fut: Unpin,
impl<Fut> !UnwindSafe for Task<Fut>
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