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(feature = "thread-pool", not(any(feature = "tokio", feature = "smol"))))]
19    pub use crate::backend::native::thread_pool::*;
20
21    #[cfg(not(any(feature = "tokio", feature = "smol", feature = "thread-pool")))]
22    pub use crate::backend::null::*;
23}
24
25#[cfg(target_arch = "wasm32")]
26mod platform {
27    pub use crate::backend::wasm::wasm_bindgen::*;
28}
29
30pub use platform::*;