iced/futures/src/maybe_send.rs
Héctor Ramón Jiménez 5dab5a327e
Introduce MaybeSend trait in iced_futures
It allows to clean up all the `trait_aliases` modules!
2022-01-28 21:37:17 +07:00

21 lines
536 B
Rust

#[cfg(not(target_arch = "wasm32"))]
mod platform {
/// An extension trait that enforces `Send` only on native platforms.
///
/// Useful to write cross-platform async code!
pub trait MaybeSend: Send {}
impl<T> MaybeSend for T where T: Send {}
}
#[cfg(target_arch = "wasm32")]
mod platform {
/// An extension trait that enforces `Send` only on native platforms.
///
/// Useful to write cross-platform async code!
pub trait MaybeSend {}
impl<T> MaybeSend for T {}
}
pub use platform::MaybeSend;