typed_path/
native.rs

1pub use self::non_utf8::*;
2pub use self::utf8::*;
3
4mod non_utf8 {
5    /// [`Encoding`](crate::Encoding) that is native to the platform during compilation
6    #[cfg(unix)]
7    pub type NativeEncoding = crate::unix::UnixEncoding;
8
9    /// [`Path`](crate::Path) that is native to the platform during compilation
10    #[cfg(unix)]
11    pub type NativePath = crate::unix::UnixPath;
12
13    /// [`PathBuf`](crate::PathBuf) that is native to the platform during compilation
14    #[cfg(unix)]
15    pub type NativePathBuf = crate::unix::UnixPathBuf;
16
17    /// [`Component`](crate::Component) that is native to the platform during compilation
18    #[cfg(unix)]
19    pub type NativeComponent<'a> = crate::unix::UnixComponent<'a>;
20
21    /// [`Encoding`](crate::Encoding) that is native to the platform during compilation
22    #[cfg(windows)]
23    pub type NativeEncoding = crate::windows::WindowsEncoding;
24
25    /// [`Path`](crate::Path) that is native to the platform during compilation
26    #[cfg(windows)]
27    pub type NativePath = crate::windows::WindowsPath;
28
29    /// [`PathBuf`](crate::PathBuf) that is native to the platform during compilation
30    #[cfg(windows)]
31    pub type NativePathBuf = crate::windows::WindowsPathBuf;
32
33    /// [`Component`](crate::Component) that is native to the platform during compilation
34    #[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    /// [`Utf8Path`](crate::Utf8Encoding) that is native to the platform during compilation
51    #[cfg(unix)]
52    pub type Utf8NativeEncoding = crate::unix::Utf8UnixEncoding;
53
54    /// [`Utf8Path`](crate::Utf8Path) that is native to the platform during compilation
55    #[cfg(unix)]
56    pub type Utf8NativePath = crate::unix::Utf8UnixPath;
57
58    /// [`Utf8PathBuf`](crate::Utf8PathBuf) that is native to the platform during compilation
59    #[cfg(unix)]
60    pub type Utf8NativePathBuf = crate::unix::Utf8UnixPathBuf;
61
62    /// [`Utf8Component`](crate::Utf8Component) that is native to the platform during compilation
63    #[cfg(unix)]
64    pub type Utf8NativeComponent<'a> = crate::unix::Utf8UnixComponent<'a>;
65
66    /// [`Utf8Path`](crate::Utf8Encoding) that is native to the platform during compilation
67    #[cfg(windows)]
68    pub type Utf8NativeEncoding = crate::windows::Utf8WindowsEncoding;
69
70    /// [`Utf8Path`](crate::Utf8Path) that is native to the platform during compilation
71    #[cfg(windows)]
72    pub type Utf8NativePath = crate::windows::Utf8WindowsPath;
73
74    /// [`Utf8PathBuf`](crate::Utf8PathBuf) that is native to the platform during compilation
75    #[cfg(windows)]
76    pub type Utf8NativePathBuf = crate::windows::Utf8WindowsPathBuf;
77
78    /// [`Utf8Component`](crate::Utf8Component) that is native to the platform during compilation
79    #[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}