Debian Codegraph @

debian/rust-vendor/futures-timer/src/lib.rs

raw
1 //! A general purpose crate for working with timeouts and delays with futures.
2 //!
3 //! # Examples
4 //!
5 //! ```no_run
6 //! # #[async_std::main]
7 //! # async fn main() {
8 //! use std::time::Duration;
9 //! use futures_timer::Delay;
10 //!
11 //! let now = Delay::new(Duration::from_secs(3)).await;
12 //! println!("waited for 3 secs");
13 //! # }
14 //! ```
15
16 #![deny(missing_docs)]
17 #![warn(missing_debug_implementations)]
18
19 #[cfg(not(all(target_arch = "wasm32", feature = "wasm-bindgen")))]
20 mod native;
21 #[cfg(all(target_arch = "wasm32", feature = "wasm-bindgen"))]
22 mod wasm;
23
24 #[cfg(not(all(target_arch = "wasm32", feature = "wasm-bindgen")))]
25 pub use self::native::Delay;
26 #[cfg(all(target_arch = "wasm32", feature = "wasm-bindgen"))]
27 pub use self::wasm::Delay;