Skip to main content

ArchSpec

Struct ArchSpec 

Source
pub struct ArchSpec {
Show 16 fields pub token: &'static str, pub spellings: &'static [&'static str], pub targets: &'static [&'static str], pub pointer_width: PointerWidth, pub max_int_register_bits: u32, pub endianness: Endianness, pub va_list: VaListAbi, pub stack_alignment_at_call: usize, pub honors_argument_alignment: bool, pub output_artifact: OutputArtifact, pub hosted_environment: TargetEnvironment, pub environments: &'static [TargetEnvironment], pub interpreters: LinuxInterpreters, pub toolchain: ToolchainTriples, pub msvc_library_arch: Option<&'static str>, pub variants: VariantAxis,
}
Expand description

Everything an architecture states about itself.

Read it through crate::Target::spec, which applies the variant’s refinements; TargetArchitecture::spec is the unrefined form the table states.

Fields§

§token: &'static str

Canonical spelling, the one Display writes.

§spellings: &'static [&'static str]

Further spellings FromStr accepts for this architecture.

§targets: &'static [&'static str]

Target strings this architecture contributes to the supported-target list.

§pointer_width: PointerWidth§max_int_register_bits: u32

Widest integer one register holds. Not the pointer width: wasm32 has 32-bit pointers and 64-bit integer registers.

§endianness: Endianness§va_list: VaListAbi

Size and alignment of this architecture’s C va_list.

§stack_alignment_at_call: usize

Alignment the stack pointer holds at a call. 1 means there is no machine stack.

§honors_argument_alignment: bool

Whether an argument with 16-byte alignment starts at its own alignment rather than at the next word. AAPCS64 rounds the integer register counter up to even before such an argument; the riscv psABI makes that rule variadic-only and ppc64 does not round for named arguments either.

§output_artifact: OutputArtifact§hosted_environment: TargetEnvironment

Environment a hosted target of this architecture means when the target string names none.

§environments: &'static [TargetEnvironment]

Environments a target string may name for this architecture, beside TargetEnvironment::Freestanding, which every architecture accepts.

§interpreters: LinuxInterpreters§toolchain: ToolchainTriples§msvc_library_arch: Option<&'static str>

Directory name under the Windows SDK Lib tree. None means Windows has no library layout for this architecture, and asking for one is an error rather than a search of the x86_64 directories.

§variants: VariantAxis

The sub-architecture axis this architecture has, and its default.

Implementations§

Source§

impl ArchSpec

Source

pub const fn data_layout(&self) -> TargetDataLayout

Source

pub const fn has_64bit_int_registers(&self) -> bool

Source

pub const fn interpreter( &self, environment: TargetEnvironment, ) -> Option<&'static str>

The ELF interpreter for an environment, or None when there is none.

Source

pub const fn toolchain_triple( &self, environment: TargetEnvironment, ) -> Option<&'static str>

The cross-toolchain triple for an environment.

Source

pub fn accepts_environment(&self, environment: TargetEnvironment) -> bool

Whether a target string may name this environment for this architecture.

Trait Implementations§

Source§

impl Clone for ArchSpec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for ArchSpec

Source§

impl Debug for ArchSpec

Source§

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

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

impl Eq for ArchSpec

Source§

impl PartialEq for ArchSpec

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ArchSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.