[][src]Struct target_spec::Platform

pub struct Platform<'a> { /* fields omitted */ }

A platform to evaluate target specs against.

Methods

impl<'a> Platform<'a>[src]

pub fn new(
    triple: impl AsRef<str>,
    target_features: TargetFeatures<'a>
) -> Option<Self>
[src]

Creates a new Platform from the given triple and target features.

Returns None if this platform wasn't known to target-spec.

pub fn add_flags(&mut self, flags: &[&'a str])[src]

Adds a set of flags to accept.

A flag is a single token like the foo in cfg(not(foo)).

A default cargo build will always evaluate flags to false, but custom wrappers may cause some flags to evaluate to true. For example, as of version 0.6, cargo web build will cause cargo_web to evaluate to true.

pub fn triple(&self) -> &'static str[src]

Returns the target triple for this platform.

pub fn has_flag(&self, flag: impl AsRef<str>) -> bool[src]

Returns true if this flag was set with add_flags.

pub fn target_features(&self) -> &TargetFeatures<'a>[src]

Returns the set of target features for this platform.

impl Platform<'static>[src]

pub fn current() -> Option<Self>[src]

Returns the current platform, as detected at build time.

This will return None if the current platform was unknown to this version of target-spec.

Trait Implementations

impl<'a> Clone for Platform<'a>[src]

impl<'a> Debug for Platform<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Platform<'a>

impl<'a> Send for Platform<'a>

impl<'a> Sync for Platform<'a>

impl<'a> Unpin for Platform<'a>

impl<'a> UnwindSafe for Platform<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.