Add function helper in iced_winit::system

This commit is contained in:
Richard 2022-03-10 01:56:25 -03:00
parent c2f45a192f
commit 0b36a55196
2 changed files with 15 additions and 0 deletions

14
winit/src/system.rs Normal file
View file

@ -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),
)))
}