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
40
41
42
43
44
// Take a look at the license at the top of the repository in the LICENSE file.

cfg_if::cfg_if! {
    if #[cfg(any(target_os = "macos", target_os = "ios"))] {
        pub(crate) mod apple;
        pub(crate) use apple as sys;

        pub(crate) use libc::__error as libc_errno;
    } else if #[cfg(any(target_os = "linux", target_os = "android"))] {
        pub(crate) mod linux;
        pub(crate) use linux as sys;

        #[cfg(target_os = "linux")]
        pub(crate) use libc::__errno_location as libc_errno;
        #[cfg(target_os = "android")]
        pub(crate) use libc::__errno as libc_errno;
    } else if #[cfg(target_os = "freebsd")] {
        pub(crate) mod freebsd;
        pub(crate) use freebsd as sys;

        pub(crate) use libc::__error as libc_errno;
    } else {
        compile_error!("Invalid cfg!");
    }
}

pub(crate) mod groups;
pub(crate) mod network_helper;
pub(crate) mod users;
pub(crate) mod utils;

pub(crate) struct DisksInner {
    pub(crate) disks: Vec<crate::Disk>,
}

impl DisksInner {
    pub(crate) fn from_vec(disks: Vec<crate::Disk>) -> Self {
        Self { disks }
    }

    pub(crate) fn into_vec(self) -> Vec<crate::Disk> {
        self.disks
    }
}