Skip to content

Commit

Permalink
time: document immediate completion guarantee for timeouts (#5509)
Browse files Browse the repository at this point in the history
  • Loading branch information
zetanumbers authored Feb 27, 2023
1 parent 5a3abe5 commit 54aaf3d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tokio/src/time/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ use std::task::{self, Poll};
/// This function returns a future whose return type is [`Result`]`<T,`[`Elapsed`]`>`, where `T` is the
/// return type of the provided future.
///
/// If the provided future completes immediatelly, then the future returned from
/// this function is guaranteed to complete immediatelly with an [`Ok`] variant
/// no matter the provided duration.
///
/// [`Ok`]: std::result::Result::Ok
/// [`Result`]: std::result::Result
/// [`Elapsed`]: crate::time::error::Elapsed
///
Expand Down Expand Up @@ -100,6 +105,11 @@ where
/// This function returns a future whose return type is [`Result`]`<T,`[`Elapsed`]`>`, where `T` is the
/// return type of the provided future.
///
/// If the provided future completes immediatelly, then the future returned from
/// this function is guaranteed to complete immediatelly with an [`Ok`] variant
/// no matter the provided deadline.
///
/// [`Ok`]: std::result::Result::Ok
/// [`Result`]: std::result::Result
/// [`Elapsed`]: crate::time::error::Elapsed
///
Expand Down

0 comments on commit 54aaf3d

Please sign in to comment.