Skip to main content

std/sys/paths/
mod.rs

1cfg_select! {
2    target_os = "hermit" => {
3        mod hermit;
4        #[expect(dead_code)]
5        mod unsupported;
6        mod imp {
7            pub use super::hermit::{getcwd, temp_dir};
8            pub use super::unsupported::{
9                JoinPathsError, SplitPaths, chdir, current_exe, home_dir, join_paths, split_paths,
10            };
11        }
12    }
13    target_os = "motor" => {
14        mod motor;
15        #[expect(dead_code)]
16        mod unsupported;
17        mod imp {
18            pub use super::motor::{
19                JoinPathsError, SplitPaths, chdir, current_exe, getcwd, home_dir, join_paths,
20                split_paths, temp_dir,
21            };
22        }
23    }
24    all(target_vendor = "fortanix", target_env = "sgx") => {
25        mod sgx;
26        #[expect(dead_code)]
27        mod unsupported;
28        mod imp {
29            pub use super::sgx::chdir;
30            pub use super::unsupported::{
31                JoinPathsError, SplitPaths, current_exe, getcwd, home_dir, join_paths, split_paths,
32                temp_dir,
33            };
34        }
35    }
36    target_os = "uefi" => {
37        mod uefi;
38        use uefi as imp;
39    }
40    target_family = "unix" => {
41        mod unix;
42        use unix as imp;
43    }
44    target_os = "wasi" => {
45        mod wasi;
46        #[expect(dead_code)]
47        mod unsupported;
48        mod imp {
49            pub use super::unsupported::{
50                JoinPathsError, SplitPaths, current_exe, home_dir, join_paths, split_paths,
51            };
52            pub use super::wasi::{chdir, getcwd, temp_dir};
53        }
54    }
55    target_os = "windows" => {
56        mod windows;
57        use windows as imp;
58    }
59    _ => {
60        mod unsupported;
61        use unsupported as imp;
62    }
63}
64
65pub use imp::{
66    JoinPathsError, SplitPaths, chdir, current_exe, getcwd, home_dir, join_paths, split_paths,
67    temp_dir,
68};