[$] Canceling asynchronous Rust

Post Syndicated from daroc original https://lwn.net/Articles/1036924/

Asynchronous Rust code has what Rain Paharia calls a “universal cancellation
protocol
“, meaning that any asynchronous code can be interrupted in the same
way. They claim
that this is both a useful feature when used deliberately, and a source of
errors when done by accident. They presented
about this problem at

RustConf 2025
, offering a handful of techniques to avoid introducing bugs into
asynchronous Rust code.