Skip to main content

Target

Struct Target 

Source
pub struct Target {
    pub triple: &'static str,
    pub os: &'static str,
    pub cpu: &'static str,
    pub libc: Option<&'static str>,
    pub wheel_platform: &'static str,
    pub exe_suffix: &'static str,
}
Expand description

One cross-compilation target and how each ecosystem names it.

Fields§

§triple: &'static str

Rust target triple, as cargo build --target takes it.

§os: &'static str

npm os field.

§cpu: &'static str

npm cpu field.

§libc: Option<&'static str>

npm libc field; only Linux distinguishes.

§wheel_platform: &'static str

Python wheel platform tag.

A manylinux_* tag is a claim about the build environment, not about this table: it holds only when the binary was linked against a glibc at least that old. sdk build warns when it cannot tell that it was.

§exe_suffix: &'static str

Executable suffix on this target.

Implementations§

Source§

impl Target

Source

pub const ALL: &'static [Target]

Every target the table knows how to describe.

Source

pub const DEFAULT: &'static [&'static str]

The matrix used when an [[sdk]] entry names no targets: the platforms a published package is expected to cover. musl is not in it — it needs its own toolchain and most consumers never ask.

Source

pub fn find(triple: &str) -> Option<&'static Target>

Look a triple up in the table.

Source

pub fn matrix(configured: &[String]) -> Result<Vec<&'static Target>, String>

The configured targets, or the default matrix when none are named. Sorted and deduplicated, so emission stays deterministic.

Source

pub fn npm_suffix(&self) -> String

The npm sub-package suffix: linux-x64, darwin-arm64, linux-x64-musl. Mirrors what esbuild and swc publish under.

Source

pub fn wheel_tag(&self) -> String

The full wheel tag hatchling wants.

Trait Implementations§

Source§

impl Clone for Target

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 Target

Source§

impl Debug for Target

Source§

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

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

impl Eq for Target

Source§

impl PartialEq for Target

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 Target

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.