pub enum Os {
Linux,
Darwin,
Windows,
FreeBsd,
NetBsd,
OpenBsd,
Wasi,
None,
}Expand description
The operating-system family a triple names.
This is what the bundled headers branch on — errno, the standard streams,
mbstate_t, struct tm, time_t, FILE — through the _WIN32 and
__APPLE__ macros the model predefines. A family whose library layout
differs therefore has to be a variant here rather than a guess.
Variants§
Linux
Linux, whatever the C library: gnu, musl, uclibc, android.
Darwin
Apple’s platforms: macOS, iOS, tvOS, watchOS, visionOS.
Windows
Windows, msvc and gnu alike.
FreeBsd
FreeBSD.
NetBsd
NetBSD.
OpenBsd
OpenBSD.
Wasi
WASI.
None
No operating system at all: a -none triple, and
wasm32-unknown-unknown.
Implementations§
Source§impl Os
impl Os
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The name used in diagnostics and in the documentation table.
Sourcepub fn macros(self) -> &'static [(&'static str, &'static str)]
pub fn macros(self) -> &'static [(&'static str, &'static str)]
The __linux__-style macros this operating system predefines.
_WIN64 is not here: it follows the pointer width rather than the
system, so TargetModel::macros adds it.