Skip to content
rusthacks.dev

Tag

async

4 posts

Flat illustration for the post “Rust Error Recursion in an Async Fn Requires Boxing”, composed around threads.
Concurrency

Rust Error Recursion in an Async Fn Requires Boxing

A recursive async fn has an infinitely sized future, so the compiler asks for indirection. Return a boxed future with Box::pin, or use the async-recursion crate, and prefer a loop when you can.

7 min read