Struct tokio::runtime::task::core::Cell

source ·
#[repr(C, align(128))]
pub(super) struct Cell<T: Future, S> { pub(super) header: Header, pub(super) core: Core<T, S>, pub(super) trailer: Trailer, }
Expand description

The task cell. Contains the components of the task.

It is critical for Header to be the first field as the task structure will be referenced by both *mut Cell and *mut Header.

Any changes to the layout of this struct must also be reflected in the const fns in raw.rs.

Fields§

§header: Header

Hot task state data

§core: Core<T, S>

Either the future or output, depending on the execution stage.

§trailer: Trailer

Cold data

Implementations§

source§

impl<T: Future, S: Schedule> Cell<T, S>

source

pub(super) fn new( future: T, scheduler: S, state: State, task_id: Id, ) -> Box<Cell<T, S>>

Allocates a new task cell, containing the header, trailer, and core structures.

Auto Trait Implementations§

§

impl<T, S> !Freeze for Cell<T, S>

§

impl<T, S> !RefUnwindSafe for Cell<T, S>

§

impl<T, S> Send for Cell<T, S>
where S: Send, T: Send, <T as Future>::Output: Send,

§

impl<T, S> !Sync for Cell<T, S>

§

impl<T, S> !Unpin for Cell<T, S>

§

impl<T, S> !UnwindSafe for Cell<T, S>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.