Skip to main content

strata_device/
lib.rs

1//! Strata Device: Hardware introspection, device telemetry, and reactive hardware signals.
2//!
3//! Provides reactive hooks for battery state, thermals, network, display geometry, safe area insets,
4//! and system-wide memory pressure eviction callbacks.
5
6pub mod mock;
7pub mod os_telemetry;
8pub mod signals;
9pub mod types;
10
11pub use mock::{DeviceMockController, DeviceTelemetrySnapshot};
12pub use os_telemetry::{
13    probe_hardware_telemetry, probe_os_battery, probe_os_network, probe_os_thermal,
14    refresh_from_hardware,
15};
16pub use signals::{
17    clear_memory_pressure_listeners, notify_memory_pressure, on_memory_pressure,
18    unregister_memory_pressure, use_battery, use_display_refresh, use_network, use_screen,
19    use_thermal,
20};
21pub use types::{
22    BatteryInfo, BatteryState, CellularGen, ColorGamut, ConnectionType, DisplayRefreshInfo,
23    GpuBackend, GpuInfo, MemoryPressure, NetworkStatus, SafeAreaInsets, ScreenGeometry,
24    ThermalState,
25};
26
27/// Device telemetry prelude module.
28pub mod prelude {
29    pub use super::mock::DeviceMockController;
30    pub use super::signals::{
31        clear_memory_pressure_listeners, notify_memory_pressure, on_memory_pressure,
32        unregister_memory_pressure, use_battery, use_display_refresh, use_network, use_screen,
33        use_thermal,
34    };
35    pub use super::types::{
36        BatteryInfo, BatteryState, CellularGen, ColorGamut, ConnectionType, DisplayRefreshInfo,
37        GpuBackend, GpuInfo, MemoryPressure, NetworkStatus, SafeAreaInsets, ScreenGeometry,
38        ThermalState,
39    };
40}