sysinfo/unix/
mod.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3cfg_if::cfg_if! {
4    if #[cfg(any(target_os = "macos", target_os = "ios"))] {
5        pub(crate) mod apple;
6        pub(crate) use apple as sys;
7
8        pub(crate) use libc::__error as libc_errno;
9    } else if #[cfg(any(target_os = "linux", target_os = "android"))] {
10        pub(crate) mod linux;
11        pub(crate) use linux as sys;
12
13        #[cfg(target_os = "linux")]
14        pub(crate) use libc::__errno_location as libc_errno;
15        #[cfg(target_os = "android")]
16        pub(crate) use libc::__errno as libc_errno;
17    } else if #[cfg(target_os = "freebsd")] {
18        pub(crate) mod freebsd;
19        pub(crate) use freebsd as sys;
20
21        pub(crate) use libc::__error as libc_errno;
22    } else {
23        compile_error!("Invalid cfg!");
24    }
25}
26
27pub(crate) mod groups;
28pub(crate) mod network_helper;
29pub(crate) mod users;
30pub(crate) mod utils;
31
32pub(crate) struct DisksInner {
33    pub(crate) disks: Vec<crate::Disk>,
34}
35
36impl DisksInner {
37    pub(crate) fn from_vec(disks: Vec<crate::Disk>) -> Self {
38        Self { disks }
39    }
40
41    pub(crate) fn into_vec(self) -> Vec<crate::Disk> {
42        self.disks
43    }
44}