mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
doc: add sleep alias to delay_for (#2589)
This commit is contained in:
parent
d22301967b
commit
0a422593f0
@ -16,6 +16,7 @@
|
|||||||
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
|
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
|
||||||
))]
|
))]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_alias))]
|
||||||
|
|
||||||
//! A runtime for writing reliable, asynchronous, and slim applications.
|
//! A runtime for writing reliable, asynchronous, and slim applications.
|
||||||
//!
|
//!
|
||||||
|
@ -33,6 +33,7 @@ pub fn delay_until(deadline: Instant) -> Delay {
|
|||||||
///
|
///
|
||||||
/// Canceling a delay is done by dropping the returned future. No additional
|
/// Canceling a delay is done by dropping the returned future. No additional
|
||||||
/// cleanup work is required.
|
/// cleanup work is required.
|
||||||
|
#[cfg_attr(docsrs, doc(alias = "sleep"))]
|
||||||
pub fn delay_for(duration: Duration) -> Delay {
|
pub fn delay_for(duration: Duration) -> Delay {
|
||||||
delay_until(Instant::now() + duration)
|
delay_until(Instant::now() + duration)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user