pub(crate) struct RawTask<F, T, S, M> {
pub(crate) header: *const Header<M>,
pub(crate) schedule: *const S,
pub(crate) future: *mut F,
pub(crate) output: *mut Result<T, Box<dyn Any + Send + 'static>>,
}Expand description
Raw pointers to the fields inside a task.
Fields§
§header: *const Header<M>The task header.
schedule: *const SThe schedule function.
future: *mut FThe future.
output: *mut Result<T, Box<dyn Any + Send + 'static>>The output of the future.
Implementations§
Source§impl<F, T, S, M> RawTask<F, T, S, M>
impl<F, T, S, M> RawTask<F, T, S, M>
const TASK_LAYOUT: TaskLayout
Sourceconst fn eval_task_layout() -> TaskLayout
const fn eval_task_layout() -> TaskLayout
Computes the memory layout for a task.
Source§impl<F, T, S, M> RawTask<F, T, S, M>
impl<F, T, S, M> RawTask<F, T, S, M>
const RAW_WAKER_VTABLE: RawWakerVTable
Sourcepub(crate) fn allocate<'a, Gen: FnOnce(&'a M) -> F>(
future: Gen,
schedule: S,
builder: Builder<M>,
) -> NonNull<()>where
F: 'a,
M: 'a,
pub(crate) fn allocate<'a, Gen: FnOnce(&'a M) -> F>(
future: Gen,
schedule: S,
builder: Builder<M>,
) -> NonNull<()>where
F: 'a,
M: 'a,
Allocates a task with the given future and schedule function.
It is assumed that initially only the Runnable and the Task exist.
Sourcefn task_layout() -> TaskLayout
fn task_layout() -> TaskLayout
Returns the layout of the task.
Sourceunsafe fn wake_by_ref(ptr: *const ())
unsafe fn wake_by_ref(ptr: *const ())
Wakes a waker by reference.
Sourceunsafe fn clone_waker(ptr: *const ()) -> RawWaker
unsafe fn clone_waker(ptr: *const ()) -> RawWaker
Clones a waker.
Sourceunsafe fn drop_waker(ptr: *const ())
unsafe fn drop_waker(ptr: *const ())
Drops a waker.
This function will decrement the reference count. If it drops down to zero, the associated
Task has been dropped too, and the task has not been completed, then it will get
scheduled one more time so that its future gets dropped by the executor.
Sourceunsafe fn drop_ref(ptr: *const ())
unsafe fn drop_ref(ptr: *const ())
Drops a task reference (Runnable or Waker).
This function will decrement the reference count. If it drops down to zero and the
associated Task handle has been dropped too, then the task gets destroyed.
Sourceunsafe fn schedule(ptr: *const (), info: ScheduleInfo)
unsafe fn schedule(ptr: *const (), info: ScheduleInfo)
Schedules a task for running.
This function doesn’t modify the state of the task. It only passes the task reference to its schedule function.
Sourceunsafe fn drop_future(ptr: *const ())
unsafe fn drop_future(ptr: *const ())
Drops the future inside a task.
Sourceunsafe fn get_output(ptr: *const ()) -> *const ()
unsafe fn get_output(ptr: *const ()) -> *const ()
Returns a pointer to the output inside a task.