2022-01-28 18:24:07 +07:00
|
|
|
//! A default, cross-platform backend.
|
|
|
|
|
//!
|
|
|
|
|
//! - On native platforms, it will use:
|
|
|
|
|
//! - `backend::native::tokio` when the `tokio` feature is enabled.
|
|
|
|
|
//! - `backend::native::smol` when the `smol` feature is enabled.
|
2025-04-02 10:45:27 +02:00
|
|
|
//! - `backend::native::thread_pool` when the `thread-pool` feature is enabled.
|
|
|
|
|
//! - `backend::null` otherwise.
|
2022-01-28 18:24:07 +07:00
|
|
|
//!
|
|
|
|
|
//! - On Wasm, it will use `backend::wasm::wasm_bindgen`.
|
|
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
|
|
|
mod platform {
|
|
|
|
|
#[cfg(feature = "tokio")]
|
|
|
|
|
pub use crate::backend::native::tokio::*;
|
|
|
|
|
|
2025-04-02 10:45:27 +02:00
|
|
|
#[cfg(all(feature = "smol", not(feature = "tokio"),))]
|
2022-01-28 18:24:07 +07:00
|
|
|
pub use crate::backend::native::smol::*;
|
|
|
|
|
|
2022-02-01 11:40:58 +07:00
|
|
|
#[cfg(all(
|
|
|
|
|
feature = "thread-pool",
|
2025-04-02 10:45:27 +02:00
|
|
|
not(any(feature = "tokio", feature = "smol"))
|
2022-02-01 11:40:58 +07:00
|
|
|
))]
|
|
|
|
|
pub use crate::backend::native::thread_pool::*;
|
|
|
|
|
|
2022-01-28 18:24:07 +07:00
|
|
|
#[cfg(not(any(
|
|
|
|
|
feature = "tokio",
|
|
|
|
|
feature = "smol",
|
2022-02-01 11:40:58 +07:00
|
|
|
feature = "thread-pool"
|
2022-01-28 18:24:07 +07:00
|
|
|
)))]
|
2022-02-01 11:40:58 +07:00
|
|
|
pub use crate::backend::null::*;
|
2022-01-28 18:24:07 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
|
mod platform {
|
|
|
|
|
pub use crate::backend::wasm::wasm_bindgen::*;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub use platform::*;
|