[][src]Struct platforms::platform::Platform

pub struct Platform {
    pub target_triple: &'static str,
    pub target_arch: Arch,
    pub target_os: OS,
    pub target_env: Option<Env>,
    pub tier: Tier,
}

Rust platforms supported by mainline rustc

Sourced from https://doc.rust-lang.org/nightly/rustc/platform-support.html

Fields

target_triple: &'static str

"Target triple" string uniquely identifying the platform. See: https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md

These are defined in the rustc_target crate of the Rust compiler: https://github.com/rust-lang/rust/blob/master/src/librustc_target/spec/mod.rs

target_arch: Arch

Target architecture cfg attribute (i.e. cfg(target_arch))

target_os: OS

Target OS cfg attribute (i.e. cfg(target_os)).

target_env: Option<Env>

Target environment cfg attribute (i.e. cfg(target_env)). Only used when needed for disambiguation, e.g. on many GNU platforms this value will be None.

tier: Tier

Tier of this platform:

  • Tier::One: guaranteed to work
  • Tier::Two: guaranteed to build
  • Tier::Three: unofficially supported with no guarantees

Implementations

impl Platform[src]

pub fn find(target_triple: &str) -> Option<&'static Platform>[src]

Find a Rust platform by its "target triple", e.g. i686-apple-darwin

pub fn guess_current() -> Option<&'static Platform>[src]

Attempt to guess the current Platform. May give inaccurate results.

pub fn all() -> &'static [Platform][src]

All valid Rust platforms usable from the mainline compiler

Trait Implementations

impl Clone for Platform[src]

impl Debug for Platform[src]

impl Display for Platform[src]

impl Eq for Platform[src]

impl Hash for Platform[src]

impl Ord for Platform[src]

impl PartialEq<Platform> for Platform[src]

impl PartialOrd<Platform> for Platform[src]

impl StructuralEq for Platform[src]

impl StructuralPartialEq for Platform[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.