This Runtime design is to understand async Rust internals properly.
Most tutorials and even Tokio's own documentation use helpers like ArcWake
from the futures crate — which hides the hard parts. This project skips all
of that and goes straight to RawWakerVTable, four raw function pointers,
manual Arc::into_raw and Arc::from_raw ownership, and unsafe Rust at the
boundary between the executor and the future.
It's not the easy path but it's the right one. Once you build a waker from
scratch you understand why async Rust is designed the way it is. why Pin
exists, what the executor is actually doing between every .await, and why
Waker is just a vtable over a raw pointer.
- Custom
Wakerbuilt directly fromRawWakerandRawWakerVTable— no helpers TimerFuture— async sleep using a background thread and a shared wakerMiniRuntime— single-threaded executor that polls futures to completion- Multiple futures running concurrently on one thread
cargo run- The full
Future→Poll→Waker→ executor contract - Why
Pinexists and what self-referential structs have to do with it unsafeRust at a real boundary — not toy examples- What Tokio does under the hood on every single
.await
Built as part of the tokio-lessons series by Freddie Haddad.