Enum wolfram_app_discovery::SystemID
source · #[non_exhaustive]pub enum SystemID {
MacOSX_x86_64,
MacOSX_ARM64,
Windows_x86_64,
Linux_x86_64,
Linux_ARM64,
Linux_ARM,
iOS_ARM64,
Android,
Windows,
Linux,
}
Expand description
Possible values of $SystemID
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MacOSX_x86_64
"MacOSX-x86-64"
MacOSX_ARM64
"MacOSX-ARM64"
Windows_x86_64
"Windows-x86-64"
Linux_x86_64
"Linux-x86-64"
Linux_ARM64
"Linux-ARM64"
Linux_ARM
"Linux-ARM"
E.g. Raspberry Pi
iOS_ARM64
"iOS-ARM64"
Android
"Android"
Windows
"Windows"
Legacy Windows 32-bit x86
Linux
"Linux"
Legacy Linux 32-bit x86
Implementations§
source§impl SystemID
impl SystemID
sourcepub fn current_rust_target() -> SystemID
pub fn current_rust_target() -> SystemID
Returns the $SystemID
value associated with the Rust
target this code is being compiled for.
Host vs. Target in build.rs
Within a build.rs script, if the current build is a cross-compilation, this function will return the system ID of the host that the build script was compiled for, and not the target system ID that the current Rust project is being compiled for.
To get the target system ID of the main build, use:
use wolfram_app_discovery::SystemID;
// Read the target from the _runtime_ environment of the build.rs script.
let target = std::env::var("TARGET").unwrap();
let system_id = SystemID::try_from_rust_target(&target).unwrap();
Panics
This function will panic if the underlying call to
SystemID::try_current_rust_target()
fails.
sourcepub fn try_current_rust_target() -> Result<SystemID, Error>
pub fn try_current_rust_target() -> Result<SystemID, Error>
Variant of SystemID::current_rust_target()
that returns an error
instead of panicking.
sourcepub fn try_from_rust_target(rust_target: &str) -> Result<SystemID, Error>
pub fn try_from_rust_target(rust_target: &str) -> Result<SystemID, Error>
Get the SystemID
value corresponding to the specified
Rust target triple.
use wolfram_app_discovery::SystemID;
assert_eq!(
SystemID::try_from_rust_target("x86_64-apple-darwin").unwrap(),
SystemID::MacOSX_x86_64
);
Trait Implementations§
source§impl Ord for SystemID
impl Ord for SystemID
source§impl PartialEq<SystemID> for SystemID
impl PartialEq<SystemID> for SystemID
source§impl PartialOrd<SystemID> for SystemID
impl PartialOrd<SystemID> for SystemID
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more