tokio::runtime::scheduler::multi_thread::worker

Type Alias Task

Source
type Task = Task<Arc<Handle>>;
Expand description

A task handle

Aliased Type§

struct Task {
    raw: RawTask,
    _p: PhantomData<Arc<Handle>>,
}

Fields§

§raw: RawTask§_p: PhantomData<Arc<Handle>>

Implementations

Source§

impl<S: 'static> Task<S>

Source

unsafe fn new(raw: RawTask) -> Task<S>

Source

unsafe fn from_raw(ptr: NonNull<Header>) -> Task<S>

Source

fn header(&self) -> &Header

Source

fn header_ptr(&self) -> NonNull<Header>

Source§

impl<S: Schedule> Task<S>

Source

pub(crate) fn shutdown(self)

Preemptively cancels the task as part of the shutdown process.

Trait Implementations

Source§

impl<S> Debug for Task<S>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: 'static> Drop for Task<S>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

type Handle = Task<S>

Handle to the list entry. Read more
Source§

type Target = Header

Node type.
Source§

fn as_raw(handle: &Task<S>) -> NonNull<Header>

Convert the handle to a raw pointer without consuming the handle.
Source§

unsafe fn from_raw(ptr: NonNull<Header>) -> Task<S>

Convert the raw pointer to a handle
Source§

unsafe fn pointers(target: NonNull<Header>) -> NonNull<Pointers<Header>>

Return the pointers for a node Read more
Source§

impl<S> ShardedListItem for Task<S>

§Safety

The id of a task is never changed after creation of the task, so the return value of get_shard_id will not change. (The cast may throw away the upper 32 bits of the task id, but the shard id still won’t change from call to call.)

Source§

unsafe fn get_shard_id(target: NonNull<Self::Target>) -> usize

Safety Read more
Source§

impl<S> Send for Task<S>

Source§

impl<S> Sync for Task<S>