pub struct PlatformReq(/* private fields */);
Expand description

Platform requirements: glob-like expressions for matching Rust platforms as identified by a “target triple”, e.g. i686-apple-darwin.

For a list of all valid platforms, “target triples”, see:

https://doc.rust-lang.org/nightly/rustc/platform-support.html

Platforms can be grouped with simple globbing rules:

  • Start with wildcard: *-gnu
  • End with wildcard: x86_64-*
  • Start and end with wildcard: *windows*

Implementations§

source§

impl PlatformReq

source

pub fn as_str(&self) -> &str

Borrow this platform requirement as a string slice

source

pub fn matches(&self, platform: &Platform) -> bool

Does this platform requirement match the given platform string?

This matcher accepts a platform “target triple” string ala x86_64-unknown-linux-gnu and matches it against this Platform, using simple glob like rules.

source

pub fn matching_platforms(&self) -> impl Iterator<Item = &Platform>

Expand glob expressions into a list of all known matching platforms

Trait Implementations§

source§

impl Clone for PlatformReq

source§

fn clone(&self) -> PlatformReq

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 PlatformReq

source§

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

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

impl Display for PlatformReq

source§

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

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

impl FromStr for PlatformReq

source§

fn from_str(req_str: &str) -> Result<PlatformReq, Error>

Create a new platform requirement. Platforms support glob-like wildcards on the beginning and end, e.g. *windows*.

Must match at least one known Rust platform “target triple” (e.g. x86_64-unknown-linux-gnu) to be considered valid.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl PartialEq for PlatformReq

source§

fn eq(&self, other: &PlatformReq) -> 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 PlatformReq

source§

impl StructuralPartialEq for PlatformReq

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> 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,

§

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.