An exploration of why async cancellation in Rust is a pain point, drawing a detailed analogy between panics and async cancellation. The post covers Rust's panic philosophy, why exceptions fail at fine-grained error recovery due to invariant violations, how the `?` operator provides explicit, auditable error propagation, and how dropping a future in async Rust resembles a panic unwinding the stack. The author argues cancellation and panics are conceptually similar but notes key differences, such as cancellation being injected externally and not being catchable. This is part one of a series.

8m read timeFrom smallcultfollowing.com
Post cover image
Table of contents
Why panics are discouraged in RustWhy exceptions are bad at fine-grained recoveryRust’s compromiseWhy ? is goodHow does this connect to async cancellation?Next timeThanksFootnotes
1 Impression