summaryrefslogtreecommitdiffstats
path: root/futures/src/maybe.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-18 09:55:27 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-18 09:55:27 +0100
commit8bf238697226e827dc983f9d89afbd0e252c5254 (patch)
tree3594e998d60b130ab6b161aa00159e2311cbde0a /futures/src/maybe.rs
parent7289b6091b61b0aa448a756cfe32211c78a4cce0 (diff)
downloadiced-8bf238697226e827dc983f9d89afbd0e252c5254.tar.gz
iced-8bf238697226e827dc983f9d89afbd0e252c5254.tar.bz2
iced-8bf238697226e827dc983f9d89afbd0e252c5254.zip
Remove `Compositor` window generic
And update `glyphon` and `window_clipboard`
Diffstat (limited to '')
-rw-r--r--futures/src/maybe.rs (renamed from futures/src/maybe_send.rs)16
1 files changed, 15 insertions, 1 deletions
diff --git a/futures/src/maybe_send.rs b/futures/src/maybe.rs
index a6670f0e..1a0bd1d1 100644
--- a/futures/src/maybe_send.rs
+++ b/futures/src/maybe.rs
@@ -6,6 +6,13 @@ mod platform {
pub trait MaybeSend: Send {}
impl<T> MaybeSend for T where T: Send {}
+
+ /// An extension trait that enforces `Sync` only on native platforms.
+ ///
+ /// Useful to write cross-platform async code!
+ pub trait MaybeSync: Sync {}
+
+ impl<T> MaybeSync for T where T: Sync {}
}
#[cfg(target_arch = "wasm32")]
@@ -16,6 +23,13 @@ mod platform {
pub trait MaybeSend {}
impl<T> MaybeSend for T {}
+
+ /// An extension trait that enforces `Send` only on native platforms.
+ ///
+ /// Useful to write cross-platform async code!
+ pub trait MaybeSync {}
+
+ impl<T> MaybeSync for T {}
}
-pub use platform::MaybeSend;
+pub use platform::{MaybeSend, MaybeSync};