Skip to main content

battery/platform/
mod.rs

1cfg_if! {
2    if #[cfg(target_os = "linux")] {
3        mod linux;
4
5        pub type Manager = linux::SysFsManager;
6        pub type Iterator = linux::SysFsIterator;
7        pub type Device = linux::SysFsDevice;
8    } else if #[cfg(any(target_os = "macos", target_os = "ios"))] {
9        mod darwin;
10
11        pub type Manager = darwin::IoKitManager;
12        pub type Iterator = darwin::IoKitIterator;
13        pub type Device = darwin::IoKitDevice;
14    } else if #[cfg(target_os = "windows")] {
15        mod windows;
16
17        pub type Manager = windows::PowerManager;
18        pub type Iterator = windows::PowerIterator;
19        pub type Device = windows::PowerDevice;
20    } else if #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] {
21        mod freebsd;
22
23        pub type Manager = freebsd::IoCtlManager;
24        pub type Iterator = freebsd::IoCtlIterator;
25        pub type Device = freebsd::IoCtlDevice;
26    } else {
27        compile_error!("Support for this target OS is not implemented yet!\n \
28            You may want to create an issue: https://github.com/svartalf/rust-battery/issues/new");
29    }
30}
31
32pub mod traits;