//! Asynchronous values. #[doc(inline)] pub use std::future::Future; /// Never resolves to a value. /// /// # Examples /// ``` /// # #![feature(async_await)] /// use async_std::future::pending; /// use async_std::prelude::*; /// use std::time::Duration; /// /// # async_std::task::block_on(async { /// let dur = Duration::from_secs(1); /// assert!(pending::<()>().timeout(dur).await.is_err()); /// # }) /// ``` pub async fn pending() -> T { futures::future::pending::().await } /// Resolves to the provided value. /// /// This function is an async version of [`std::convert::identity`]. /// /// [`std::convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html /// /// # Examples /// /// ``` /// # #![feature(async_await)] /// use async_std::future::ready; /// /// # async_std::task::block_on(async { /// assert_eq!(ready(10).await, 10); /// # }) /// ``` pub async fn ready(val: T) -> T { val }