1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Native, OS-event-driven monitors.
//!
//! [`try_spawn`] returns `Ok(Some(handle))` when the current platform has a
//! native event source for `kind`, or `Ok(None)` to fall back to polling.
//!
//! ## Roadmap (each entry requires on-device verification)
//!
//! | Kind | macOS | Windows | Linux |
//! |---------|-----------------------------------------|--------------------------------------|--------------------------------|
//! | battery | IOKit `IOPSNotificationCreateRunLoopSource` ✅ | `RegisterPowerSettingNotification` | UPower / D-Bus |
//! | display | `CGDisplayRegisterReconfigurationCallback` ✅ | `WM_DISPLAYCHANGE` | XRandR |
//! | network | `SCNetworkReachability` | `NotifyUnicastIpAddressChange` | netlink / NetworkManager |
//! | storage | *(no OS event — always polled)* | *(polled)* | *(polled)* |
//! | device | *(rarely changes — polled)* | *(polled)* | *(polled)* |
use ;
use MonitorHandle;
/// Returns a native event-driven monitor for `kind` if this platform supports
/// one, else `Ok(None)` so the caller falls back to polling.
pub