time: document Interval::tick cancel safety (#4152)

This commit is contained in:
Alice Ryhl
2021-10-05 15:55:15 +02:00
committed by GitHub
parent c5d37204dc
commit d047584e86
+5
View File
@@ -367,6 +367,11 @@ pub struct Interval {
impl Interval {
/// Completes when the next instant in the interval has been reached.
///
/// # Cancel safety
///
/// This method is cancellation safe. If `tick` is used as the branch in a `tokio::select!` and
/// another branch completes first, then no tick has been consumed.
///
/// # Examples
///
/// ```