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>

source

pub(super) fn waker_ref(this: &Arc<Self>) -> WakerRef<'_>

Returns a waker reference for this task without cloning the Arc.

source

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§

source§

impl<Fut> ArcWake for Task<Fut>

source§

fn wake_by_ref(arc_self: &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<Fut> Drop for Task<Fut>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<Fut> Send for Task<Fut>

source§

impl<Fut> Sync for Task<Fut>

Auto Trait Implementations§

§

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> 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.