Struct tokio::runtime::task::raw::RawTask

source ·
pub(crate) struct RawTask {
    ptr: NonNull<Header>,
}
Expand description

Raw task handle

Fields§

§ptr: NonNull<Header>

Implementations§

source§

impl RawTask

Task operations that can be implemented without being generic over the scheduler or task. Only one version of these methods should exist in the final binary.

source

pub(super) fn drop_reference(self)

source

pub(super) fn wake_by_val(&self)

This call consumes a ref-count and notifies the task. This will create a new Notified and submit it if necessary.

The caller does not need to hold a ref-count besides the one that was passed to this call.

source

pub(super) fn wake_by_ref(&self)

This call notifies the task. It will not consume any ref-counts, but the caller should hold a ref-count. This will create a new Notified and submit it if necessary.

source

pub(super) fn remote_abort(&self)

Remotely aborts the task.

The caller should hold a ref-count, but we do not consume it.

This is similar to shutdown except that it asks the runtime to perform the shutdown. This is necessary to avoid the shutdown happening in the wrong thread for non-Send tasks.

source

pub(super) fn try_set_join_waker(&self, waker: &Waker) -> bool

Try to set the waker notified when the task is complete. Returns true if the task has already completed. If this call returns false, then the waker will not be notified.

source§

impl RawTask

source

pub(super) fn new<T, S>(task: T, scheduler: S, id: Id) -> RawTask
where T: Future, S: Schedule,

source

pub(super) unsafe fn from_raw(ptr: NonNull<Header>) -> RawTask

source

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

source

pub(super) fn trailer_ptr(&self) -> NonNull<Trailer>

source

pub(super) fn header(&self) -> &Header

Returns a reference to the task’s header.

source

pub(super) fn trailer(&self) -> &Trailer

Returns a reference to the task’s trailer.

source

pub(super) fn state(&self) -> &State

Returns a reference to the task’s state.

source

pub(crate) fn poll(self)

Safety: mutual exclusion is required to call this function.

source

pub(super) fn schedule(self)

source

pub(super) fn dealloc(self)

source

pub(super) unsafe fn try_read_output(self, dst: *mut (), waker: &Waker)

Safety: dst must be a *mut Poll<super::Result<T::Output>> where T is the future stored by the task.

source

pub(super) fn drop_join_handle_slow(self)

source

pub(super) fn drop_abort_handle(self)

source

pub(super) fn shutdown(self)

source

pub(super) fn ref_inc(self)

Increment the task’s reference count.

Currently, this is used only when creating an AbortHandle.

source

pub(crate) unsafe fn get_queue_next(self) -> Option<RawTask>

Get the queue-next pointer

This is for usage by the injection queue

Safety: make sure only one queue uses this and access is synchronized.

source

pub(crate) unsafe fn set_queue_next(self, val: Option<RawTask>)

Sets the queue-next pointer

This is for usage by the injection queue

Safety: make sure only one queue uses this and access is synchronized.

Trait Implementations§

source§

impl Clone for RawTask

source§

fn clone(&self) -> RawTask

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for RawTask

Auto Trait Implementations§

§

impl Freeze for RawTask

§

impl !RefUnwindSafe for RawTask

§

impl !Send for RawTask

§

impl !Sync for RawTask

§

impl Unpin for RawTask

§

impl !UnwindSafe for RawTask

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.