diff options
author | 2022-03-10 01:56:25 -0300 | |
---|---|---|
committer | 2022-04-26 18:55:51 -0300 | |
commit | 0b36a55196300371343a1614cec61ac041f160f4 (patch) | |
tree | 38db223d14787641e636fec568b925001e5c40f5 /winit/src/system.rs | |
parent | c2f45a192fdeba5eec79158dda8640a99a36fdb1 (diff) | |
download | iced-0b36a55196300371343a1614cec61ac041f160f4.tar.gz iced-0b36a55196300371343a1614cec61ac041f160f4.tar.bz2 iced-0b36a55196300371343a1614cec61ac041f160f4.zip |
Add function helper in `iced_winit::system`
Diffstat (limited to 'winit/src/system.rs')
-rw-r--r-- | winit/src/system.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/winit/src/system.rs b/winit/src/system.rs new file mode 100644 index 00000000..cd3ba075 --- /dev/null +++ b/winit/src/system.rs @@ -0,0 +1,14 @@ +//! Access the native system. +use crate::command::{self, Command}; +use iced_native::system; + +/// Query for available system information. +/// +/// Returns `None` if not using the `sysinfo` feature flag. +pub fn information<Message>( + f: impl Fn(Option<system::Information>) -> Message + 'static, +) -> Command<Message> { + Command::single(command::Action::System(system::Action::QueryInformation( + Box::new(f), + ))) +} |