async-rs / async-rs/async-task
Why does the RawTask use raw pointers
- Dominant language
- Rust
- Stars
- 212
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
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 {
/// 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,
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the RawTask definition shown in the issue and trace how its header, schedule, tag, future, and output pointers are created and accessed. Review the surrounding task implementation to identify the ownership and lifetime constraints; the issue is done when those choices are documented clearly, including whether performance is a stated motivation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100