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::smol` when the `smol` feature is enabled.
6//!   - `backend::native::thread_pool` when the `thread-pool` feature is enabled.
7//!   - `backend::null` otherwise.
8//!
9//! - On Wasm, it will use `backend::wasm::wasm_bindgen`.
10#[cfg(not(target_arch = "wasm32"))]
11mod platform {
12    #[cfg(feature = "tokio")]
13    pub use crate::backend::native::tokio::*;
14
15    #[cfg(all(feature = "smol", not(feature = "tokio"),))]
16    pub use crate::backend::native::smol::*;
17
18    #[cfg(all(
19        feature = "thread-pool",
20        not(any(feature = "tokio", feature = "smol"))
21    ))]
22    pub use crate::backend::native::thread_pool::*;
23
24    #[cfg(not(any(
25        feature = "tokio",
26        feature = "smol",
27        feature = "thread-pool"
28    )))]
29    pub use crate::backend::null::*;
30}
31
32#[cfg(target_arch = "wasm32")]
33mod platform {
34    pub use crate::backend::wasm::wasm_bindgen::*;
35}
36
37pub use platform::*;