pub(crate) struct RawTask {
ptr: NonNull<Header>,
}
Expand description
Raw task handle
Fields§
§ptr: NonNull<Header>
Implementations§
source§impl RawTask
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.
pub(super) fn drop_reference(self)
sourcepub(super) fn wake_by_val(&self)
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.
sourcepub(super) fn wake_by_ref(&self)
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.
sourcepub(super) fn remote_abort(&self)
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.
sourcepub(super) fn try_set_join_waker(&self, waker: &Waker) -> bool
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
impl RawTask
pub(super) fn new<T, S>(task: T, scheduler: S, id: Id) -> RawTask
pub(super) unsafe fn from_raw(ptr: NonNull<Header>) -> RawTask
pub(super) fn header_ptr(&self) -> NonNull<Header>
pub(super) fn trailer_ptr(&self) -> NonNull<Trailer>
pub(super) fn schedule(self)
pub(super) fn dealloc(self)
sourcepub(super) unsafe fn try_read_output(self, dst: *mut (), waker: &Waker)
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.
pub(super) fn drop_join_handle_slow(self)
pub(super) fn drop_abort_handle(self)
pub(super) fn shutdown(self)
sourcepub(super) fn ref_inc(self)
pub(super) fn ref_inc(self)
Increment the task’s reference count.
Currently, this is used only when creating an AbortHandle
.
sourcepub(crate) unsafe fn get_queue_next(self) -> Option<RawTask>
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.
sourcepub(crate) unsafe fn set_queue_next(self, val: Option<RawTask>)
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§
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> 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)