async-task icon indicating copy to clipboard operation
async-task copied to clipboard

Why does the RawTask use raw pointers

Open brianshih1 opened this issue 1 year ago • 0 comments

Pure for learning purposes, why does RawTask use raw pointers for output, header, etc? Is it mostly for performance reason?

/// Raw pointers to the fields inside a task.
pub(crate) struct RawTask<F, R, S, T> {
    /// The task header.
    pub(crate) header: *const Header,

    /// The schedule function.
    pub(crate) schedule: *const S,

    /// The tag inside the task.
    pub(crate) tag: *mut T,

    /// The future.
    pub(crate) future: *mut F,

    /// The output of the future.
    pub(crate) output: *mut R,
}

brianshih1 avatar Jul 27 '24 03:07 brianshih1