#[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 PartialOrd for Platform
impl PartialOrd for Platform
impl Eq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations§
impl Freeze for Platform
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnwindSafe for Platform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.