1pub use self::non_utf8::*;
2pub use self::utf8::*;
3
4mod non_utf8 {
5 #[cfg(unix)]
7 pub type NativeEncoding = crate::unix::UnixEncoding;
8
9 #[cfg(unix)]
11 pub type NativePath = crate::unix::UnixPath;
12
13 #[cfg(unix)]
15 pub type NativePathBuf = crate::unix::UnixPathBuf;
16
17 #[cfg(unix)]
19 pub type NativeComponent<'a> = crate::unix::UnixComponent<'a>;
20
21 #[cfg(windows)]
23 pub type NativeEncoding = crate::windows::WindowsEncoding;
24
25 #[cfg(windows)]
27 pub type NativePath = crate::windows::WindowsPath;
28
29 #[cfg(windows)]
31 pub type NativePathBuf = crate::windows::WindowsPathBuf;
32
33 #[cfg(windows)]
35 pub type NativeComponent<'a> = crate::windows::WindowsComponent<'a>;
36
37 #[cfg(test)]
38 mod tests {
39 use super::*;
40
41 #[test]
42 fn native_path_buf_should_be_cloneable() {
43 let path = NativePathBuf::from("hello.txt");
44 assert_eq!(path, path.clone());
45 }
46 }
47}
48
49mod utf8 {
50 #[cfg(unix)]
52 pub type Utf8NativeEncoding = crate::unix::Utf8UnixEncoding;
53
54 #[cfg(unix)]
56 pub type Utf8NativePath = crate::unix::Utf8UnixPath;
57
58 #[cfg(unix)]
60 pub type Utf8NativePathBuf = crate::unix::Utf8UnixPathBuf;
61
62 #[cfg(unix)]
64 pub type Utf8NativeComponent<'a> = crate::unix::Utf8UnixComponent<'a>;
65
66 #[cfg(windows)]
68 pub type Utf8NativeEncoding = crate::windows::Utf8WindowsEncoding;
69
70 #[cfg(windows)]
72 pub type Utf8NativePath = crate::windows::Utf8WindowsPath;
73
74 #[cfg(windows)]
76 pub type Utf8NativePathBuf = crate::windows::Utf8WindowsPathBuf;
77
78 #[cfg(windows)]
80 pub type Utf8NativeComponent<'a> = crate::windows::Utf8WindowsComponent<'a>;
81
82 #[cfg(test)]
83 mod tests {
84 use super::*;
85
86 #[test]
87 fn utf8_native_path_buf_should_be_cloneable() {
88 let path = Utf8NativePathBuf::from("hello.txt");
89 assert_eq!(path, path.clone());
90 }
91 }
92}