Every async function in Rust compiles into a state machine struct. This post shows exactly what the compiler generates, why some futures are large, why Pin is required, and how the zero-cost composition model works in practice.
Come and explore with me
Every async function in Rust compiles into a state machine struct. This post shows exactly what the compiler generates, why some futures are large, why Pin is required, and how the zero-cost composition model works in practice.