Debian Codegraph @

src/lib_impl.rs

raw symbols SCIP
1 // "plumbing" setup and connections for `lib.rs`
2
3 #![warn(unused_results)] // enable warnings for unused results
4
5 #[cfg(target_os = "windows")]
6 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#;
7 #[cfg(target_os = "windows")]
8 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#;
9
10 //=== types
11
12 /// Standard thread-safe error type
13 pub type ThreadSafeStdErrorrust-analyzer cargo platform-info 2.0.5 lib_impl/ThreadSafeStdError# = dyn stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync#;
14 /// Standard thread-safe error type (boxed to allow translation for any `std::error::Error` type)
15 pub type BoxedThreadSafeStdErrorrust-analyzer cargo platform-info 2.0.5 lib_impl/BoxedThreadSafeStdError# = Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<ThreadSafeStdErrorrust-analyzer cargo platform-info 2.0.5 lib_impl/ThreadSafeStdError#>;
16
17 /// A slice of a path string
18 /// (akin to [`str`]; aka/equivalent to [`Path`]).
19 #[cfg(target_os = "windows")]
20 type PathStr = Path;
21 /// An owned, mutable path string
22 /// (akin to [`String`]; aka/equivalent to [`PathBuf`]).
23 #[cfg(target_os = "windows")]
24 type PathString = PathBuf;
25
26 //=== platform-specific const
27
28 // HOST_OS_NAME * ref: [`uname` info](https://en.wikipedia.org/wiki/Uname)
29 const HOST_OS_NAMErust-analyzer cargo platform-info 2.0.5 lib_impl/HOST_OS_NAME.: &str = if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(all(
30 target_os = "linux",
31 any(target_env = "gnu", target_env = "")
32 )) {
33 "GNU/Linux"
34 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(all(
35 target_os = "linux",
36 not(any(target_env = "gnu", target_env = ""))
37 )) {
38 "Linux"
39 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "android") {
40 "Android"
41 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "windows") {
42 "MS/Windows" // prior art == `busybox`
43 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "freebsd") {
44 "FreeBSD"
45 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "netbsd") {
46 "NetBSD"
47 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "openbsd") {
48 "OpenBSD"
49 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_vendor = "apple") {
50 "Darwin"
51 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "fuchsia") {
52 "Fuchsia"
53 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "redox") {
54 "Redox"
55 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "illumos") {
56 "illumos"
57 } else if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(target_os = "solaris") {
58 "solaris"
59 } else {
60 "unknown"
61 };
62
63 //=== platform-specific module code
64
65 #[cfg(unix)]
66 #[path = "platform/unix.rs"]
67 mod targetrust-analyzer cargo platform-info 2.0.5 lib_impl/target/;
68 #[cfg(windows)]
69 #[path = "platform/windows.rs"]
70 mod targetrust-analyzer cargo platform-info 2.0.5 lib_impl/target/;
71 #[cfg(not(any(unix, windows)))]
72 #[path = "platform/unknown.rs"]
73 mod targetrust-analyzer cargo platform-info 2.0.5 lib_impl/target/;
74
75 pub use targetrust-analyzer cargo platform-info 2.0.5 lib_impl/target/::*;