Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: document immediate completion guarantee for timeouts #5509

Merged
merged 2 commits into from Feb 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions tokio/src/time/timeout.rs
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 future returned from this
/// function is guaranteed to complete immediatelly with an [`Ok`] variant no
/// matter the provided duration.
zetanumbers marked this conversation as resolved.
Show resolved Hide resolved
///
/// [`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 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