system_info/
lib.rs

1//! System information library
2//!
3//!## Requirements
4//!
5//!- `alloc` - Requires heap allocations to store network data on unix & windows systems.
6//!
7//!## Features
8//!
9//!- `std` - Enables std's types support;
10
11#![no_std]
12#![warn(missing_docs)]
13#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
14#![cfg_attr(feature = "cargo-clippy", allow(clippy::needless_lifetimes))]
15
16#[allow(unused)]
17#[cfg(not(debug_assertions))]
18macro_rules! unreach {
19    () => ({
20        #[allow(unused_unsafe)]
21        unsafe {
22            core::hint::unreachable_unchecked();
23        }
24    })
25}
26
27#[allow(unused)]
28#[cfg(debug_assertions)]
29macro_rules! unreach {
30    () => ({
31        unreachable!()
32    })
33}
34
35mod data;
36
37#[cfg(not(any(unix, windows)))]
38mod unknown;
39#[cfg(not(any(unix, windows)))]
40pub use unknown::*;
41
42#[cfg(windows)]
43mod win32;
44#[cfg(windows)]
45pub use win32::*;
46
47#[cfg(unix)]
48mod unix;
49#[cfg(unix)]
50pub use unix::*;
51
52pub use network::Interfaces as NetworkInterfaces;
53pub use mem::SystemMemory;