#[non_exhaustive]pub struct Platform {
pub target_triple: &'static str,
pub target_arch: Arch,
pub target_os: OS,
pub target_env: Env,
pub target_pointer_width: PointerWidth,
pub target_endian: Endian,
pub tier: Tier,
}
Expand description
Rust platforms supported by mainline rustc
Sourced from https://doc.rust-lang.org/nightly/rustc/platform-support.html
as well as the latest nightly version of rustc
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.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: 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
.
target_pointer_width: PointerWidth
Target pointer width cfg
attribute, in bits (i.e. cfg(target_pointer_width)
).
Typically 64 on modern platforms, 32 on older platforms, 16 on some microcontrollers.
target_endian: Endian
Target endianness cfg
attribute (i.e. cfg(target_endian)
).
Set to “little” on the vast majority of modern platforms.
tier: Tier
Tier of this platform:
Tier::One
: guaranteed to workTier::Two
: guaranteed to buildTier::Three
: unofficially supported with no guarantees
Implementations§
Trait Implementations§
source§impl Ord for Platform
impl Ord for Platform
source§impl PartialEq for Platform
impl PartialEq for Platform
source§impl PartialOrd for Platform
impl PartialOrd for Platform
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