Struct maturin::Target

source ·
pub struct Target { /* private fields */ }
Expand description

The part of the current platform that is relevant when building wheels and is supported

Implementations§

source§

impl Target

source

pub fn from_target_triple(target_triple: Option<String>) -> Result<Self>

Uses the given target triple or tries the guess the current target by using the one used for compilation

Fails if the target triple isn’t supported

source

pub fn get_platform_arch(&self) -> Result<String>

Returns the platform architecture

source

pub fn get_platform_release(&self) -> Result<String>

Returns the platform release

source

pub fn get_python_arch(&self) -> &str

Returns the name python uses in sys.platform for this architecture.

source

pub fn get_python_os(&self) -> &str

Returns the name python uses in sys.platform for this os

source

pub fn get_minimum_manylinux_tag(&self) -> PlatformTag

Returns the oldest possible Manylinux tag for this architecture

source

pub fn pointer_width(&self) -> usize

Returns whether the platform is 64 bit or 32 bit

source

pub fn target_triple(&self) -> &str

Returns target triple as string

source

pub fn host_triple(&self) -> &str

Returns host triple as string

source

pub fn is_unix(&self) -> bool

Returns true if the current platform is not windows

source

pub fn target_os(&self) -> Os

Returns target operating system

source

pub fn target_arch(&self) -> Arch

Returns target architecture

source

pub fn target_env(&self) -> Environment

Returns target environment

source

pub fn is_linux(&self) -> bool

Returns true if the current platform is linux

source

pub fn is_freebsd(&self) -> bool

Returns true if the current platform is freebsd

source

pub fn is_macos(&self) -> bool

Returns true if the current platform is mac os

source

pub fn is_windows(&self) -> bool

Returns true if the current platform is windows

source

pub fn is_msvc(&self) -> bool

Returns true if the current environment is msvc

source

pub fn is_illumos(&self) -> bool

Returns true if the current platform is illumos

source

pub fn is_haiku(&self) -> bool

Returns true if the current platform is haiku

source

pub fn is_emscripten(&self) -> bool

Returns true if the current platform is Emscripten

source

pub fn is_wasi(&self) -> bool

Returns true if we’re building a binary for wasm32-wasi

source

pub fn is_musl_libc(&self) -> bool

Returns true if the current platform’s target env is Musl

source

pub fn cross_compiling(&self) -> bool

Is cross compiling for this target

source

pub fn get_venv_python(&self, venv_base: impl AsRef<Path>) -> PathBuf

Returns the path to the python executable inside a venv

source

pub fn get_venv_bin_dir(&self, venv_base: impl AsRef<Path>) -> PathBuf

Returns the directory where the binaries are stored inside a venv

source

pub fn get_python(&self) -> PathBuf

Returns the path to the python executable

For windows it’s always python.exe for unix it’s first the venv’s python and then python3

Trait Implementations§

source§

impl Clone for Target

source§

fn clone(&self) -> Target

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Target

source§

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

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

impl Display for Target

source§

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

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

impl PartialEq for Target

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Target

source§

impl StructuralPartialEq for Target

Auto Trait Implementations§

§

impl Freeze for Target

§

impl RefUnwindSafe for Target

§

impl Send for Target

§

impl Sync for Target

§

impl Unpin for Target

§

impl UnwindSafe for Target

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> Chain<T> for T

source§

fn len(&self) -> usize

The number of items that this chain link consists of.
source§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
source§

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

§

type Iter = Once<T>

An iterator over the items within this container, by value.
source§

fn get_iter(&self) -> <T as Container<T>>::Iter

Iterate over the elements of the container (using internal iteration because GATs are unstable).
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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