iced_futures/backend/
default.rs

1//! A default, cross-platform backend.
2//!
3//! - On native platforms, it will use:
4//!   - `backend::native::tokio` when the `tokio` feature is enabled.
5//!   - `backend::native::async-std` when the `async-std` feature is
6//!     enabled.
7//!   - `backend::native::smol` when the `smol` feature is enabled.
8//!   - `backend::native::thread_pool` otherwise.
9//!
10//! - On Wasm, it will use `backend::wasm::wasm_bindgen`.
11#[cfg(not(target_arch = "wasm32"))]
12mod platform {
13    #[cfg(feature = "tokio")]
14    pub use crate::backend::native::tokio::*;
15
16    #[cfg(all(feature = "async-std", not(feature = "tokio"),))]
17    pub use crate::backend::native::async_std::*;
18
19    #[cfg(all(
20        feature = "smol",
21        not(any(feature = "tokio", feature = "async-std")),
22    ))]
23    pub use crate::backend::native::smol::*;
24
25    #[cfg(all(
26        feature = "thread-pool",
27        not(any(feature = "tokio", feature = "async-std", feature = "smol"))
28    ))]
29    pub use crate::backend::native::thread_pool::*;
30
31    #[cfg(not(any(
32        feature = "tokio",
33        feature = "async-std",
34        feature = "smol",
35        feature = "thread-pool"
36    )))]
37    pub use crate::backend::null::*;
38}
39
40#[cfg(target_arch = "wasm32")]
41mod platform {
42    pub use crate::backend::wasm::wasm_bindgen::*;
43}
44
45pub use platform::*;