Skip to content

Commit

Permalink
time: document Interval::tick cancel safety (#4152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Oct 5, 2021
1 parent c5d3720 commit d047584
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tokio/src/time/interval.rs
Expand Up @@ -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
///
/// ```
Expand Down

0 comments on commit d047584

Please sign in to comment.