Add function helper in iced_winit::system
This commit is contained in:
parent
c2f45a192f
commit
0b36a55196
2 changed files with 15 additions and 0 deletions
14
winit/src/system.rs
Normal file
14
winit/src/system.rs
Normal 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),
|
||||
)))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue