mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
time: document Interval::tick cancel safety (#4152)
This commit is contained in:
@@ -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
|
||||
///
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user