#[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
sourceimpl Ord for Platform
impl Ord for Platform
sourceimpl PartialOrd<Platform> for Platform
impl PartialOrd<Platform> for Platform
sourcefn partial_cmp(&self, other: &Platform) -> Option<Ordering>
fn partial_cmp(&self, other: &Platform) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
impl Eq for Platform
impl StructuralEq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnwindSafe for Platform
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more