[−][src]Struct target_spec::Platform
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]
triple: impl AsRef<str>,
target_features: TargetFeatures<'a>
) -> Option<Self>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,