summaryrefslogtreecommitdiffstats
path: root/winit/src/system.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-06-14 01:47:39 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-06-14 01:47:39 +0200
commita25b1af45690bdd8e1cbb20ee3a5b1c4342de455 (patch)
tree432044cf682dd73d1019a2f964749e78db178865 /winit/src/system.rs
parente6d0b3bda5042a1017a5944a5227c97e0ed6caf9 (diff)
downloadiced-a25b1af45690bdd8e1cbb20ee3a5b1c4342de455.tar.gz
iced-a25b1af45690bdd8e1cbb20ee3a5b1c4342de455.tar.bz2
iced-a25b1af45690bdd8e1cbb20ee3a5b1c4342de455.zip
Replace `Command` with a new `Task` API with chain support
Diffstat (limited to 'winit/src/system.rs')
-rw-r--r--winit/src/system.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/winit/src/system.rs b/winit/src/system.rs
index c5a5b219..7997f311 100644
--- a/winit/src/system.rs
+++ b/winit/src/system.rs
@@ -1,15 +1,13 @@
//! Access the native system.
use crate::graphics::compositor;
-use crate::runtime::command::{self, Command};
use crate::runtime::system::{Action, Information};
+use crate::runtime::{self, Task};
/// Query for available system information.
-pub fn fetch_information<Message>(
- f: impl Fn(Information) -> Message + Send + 'static,
-) -> Command<Message> {
- Command::single(command::Action::System(Action::QueryInformation(
- Box::new(f),
- )))
+pub fn fetch_information() -> Task<Information> {
+ Task::oneshot(|channel| {
+ runtime::Action::System(Action::QueryInformation(channel))
+ })
}
pub(crate) fn information(