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