2022-03-10 01:56:25 -03:00
|
|
|
//! Access the native system.
|
|
|
|
|
use crate::command::{self, Command};
|
2022-03-10 03:01:12 -03:00
|
|
|
pub use iced_native::system::*;
|
2022-03-10 01:56:25 -03:00
|
|
|
|
|
|
|
|
/// Query for available system information.
|
|
|
|
|
///
|
|
|
|
|
/// Returns `None` if not using the `sysinfo` feature flag.
|
|
|
|
|
pub fn information<Message>(
|
2022-03-10 03:01:12 -03:00
|
|
|
f: impl Fn(Option<Information>) -> Message + 'static,
|
2022-03-10 01:56:25 -03:00
|
|
|
) -> Command<Message> {
|
2022-03-10 03:01:12 -03:00
|
|
|
Command::single(command::Action::System(Action::QueryInformation(
|
2022-03-10 01:56:25 -03:00
|
|
|
Box::new(f),
|
|
|
|
|
)))
|
|
|
|
|
}
|