iced_runtime/
system.rs

1//! Access the native system.
2use crate::futures::futures::channel::oneshot;
3
4/// An operation to be performed on the system.
5#[derive(Debug)]
6pub enum Action {
7    /// Query system information and produce `T` with the result.
8    QueryInformation(oneshot::Sender<Information>),
9}
10
11/// Contains information about the system (e.g. system name, processor, memory, graphics adapter).
12#[derive(Clone, Debug)]
13pub struct Information {
14    /// The operating system name
15    pub system_name: Option<String>,
16    /// Operating system kernel version
17    pub system_kernel: Option<String>,
18    /// Long operating system version
19    ///
20    /// Examples:
21    /// - MacOS 10.15 Catalina
22    /// - Windows 10 Pro
23    /// - Ubuntu 20.04 LTS (Focal Fossa)
24    pub system_version: Option<String>,
25    /// Short operating system version number
26    pub system_short_version: Option<String>,
27    /// Detailed processor model information
28    pub cpu_brand: String,
29    /// The number of physical cores on the processor
30    pub cpu_cores: Option<usize>,
31    /// Total RAM size, in bytes
32    pub memory_total: u64,
33    /// Memory used by this process, in bytes
34    pub memory_used: Option<u64>,
35    /// Underlying graphics backend for rendering
36    pub graphics_backend: String,
37    /// Model information for the active graphics adapter
38    pub graphics_adapter: String,
39}