| 1 | // Take a look at the license at the top of the repository in the LICENSE file. |
| 2 | |
| 3 | 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 | #[allow(unused_imports)] |
| 9 | pub(crate) use libc::__error as libc_errno; |
| 10 | } else if #[cfg(any(target_os = "linux" , target_os = "android" ))] { |
| 11 | pub(crate) mod linux; |
| 12 | pub(crate) use linux as sys; |
| 13 | |
| 14 | #[cfg (target_os = "linux" )] |
| 15 | #[allow (unused_imports)] |
| 16 | pub(crate) use libc::__errno_location as libc_errno; |
| 17 | #[cfg (target_os = "android" )] |
| 18 | #[allow (unused_imports)] |
| 19 | pub(crate) use libc::__errno as libc_errno; |
| 20 | } else if #[cfg(target_os = "freebsd" )] { |
| 21 | pub(crate) mod freebsd; |
| 22 | pub(crate) use freebsd as sys; |
| 23 | |
| 24 | #[allow(unused_imports)] |
| 25 | pub(crate) use libc::__error as libc_errno; |
| 26 | } else { |
| 27 | compile_error!("Invalid cfg!" ); |
| 28 | } |
| 29 | |
| 30 | if #[cfg(feature = "disk" )] { |
| 31 | pub(crate) struct DisksInner { |
| 32 | pub(crate) disks: Vec<crate::Disk>, |
| 33 | } |
| 34 | |
| 35 | impl DisksInner { |
| 36 | pub(crate) fn from_vec(disks: Vec<crate::Disk>) -> Self { |
| 37 | Self { disks } |
| 38 | } |
| 39 | |
| 40 | pub(crate) fn into_vec(self) -> Vec<crate::Disk> { |
| 41 | self.disks |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | if #[cfg(feature = "network" )] { |
| 47 | pub(crate) mod network_helper; |
| 48 | } |
| 49 | |
| 50 | if #[cfg(feature = "user" )] { |
| 51 | pub(crate) mod users; |
| 52 | pub(crate) mod groups; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | pub(crate) mod utils; |
| 57 | |