cancel safety
Whether stopping a future halfway can lose data or leave things half-done.
Dropping a future cancels it at its current await point; a cancel-safe operation (e.g. mpsc::Receiver::recv) loses nothing if cancelled there, which matters inside select! loops.
Loading interactive…
Examples
timeout(Duration::from_millis(100), book_van())drops the future at 100 ms, so itsBayReservationguard'sDropruns and releases the bay, but the van is never booked.
See also