#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

source

pub const fn as_str(self) -> &'static str

$SystemID string value of this SystemID.

source

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.

source

pub fn try_current_rust_target() -> Result<SystemID, Error>

Variant of SystemID::current_rust_target() that returns an error instead of panicking.

source

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 Clone for SystemID

source§

fn clone(&self) -> SystemID

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SystemID

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for SystemID

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for SystemID

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(string: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for SystemID

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for SystemID

source§

fn cmp(&self, other: &SystemID) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<SystemID> for SystemID

source§

fn eq(&self, other: &SystemID) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<SystemID> for SystemID

source§

fn partial_cmp(&self, other: &SystemID) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for SystemID

source§

impl Eq for SystemID

source§

impl StructuralEq for SystemID

source§

impl StructuralPartialEq for SystemID

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.