summaryrefslogtreecommitdiffstats
path: root/winit/src/system.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-06-16 20:24:41 +0200
committerLibravatar GitHub <noreply@github.com>2024-06-16 20:24:41 +0200
commit95d4adb55e485c01eec839736f328be26f2ccab6 (patch)
tree2676e3cb8ec17c5bf1cd561d97932ae302551dfd /winit/src/system.rs
parente6d0b3bda5042a1017a5944a5227c97e0ed6caf9 (diff)
parentb5c5a016c4f2b608a740b37c494186557a064f48 (diff)
downloadiced-95d4adb55e485c01eec839736f328be26f2ccab6.tar.gz
iced-95d4adb55e485c01eec839736f328be26f2ccab6.tar.bz2
iced-95d4adb55e485c01eec839736f328be26f2ccab6.zip
Merge pull request #2463 from iced-rs/task-api
`Task` API
Diffstat (limited to '')
-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(