Rust - Cancellation safety
We need to aware of cancellation safety on using select. Rust doc will describe the method the cancellation safety on IO operations.
1
2
Cancel safety
This method is cancellation safe in the sense that if it is used as the event in a tokio::select! statement and some other branch completes first, then it is guaranteed that no data was written to this AsyncWrite.