Enum target_tuples::Environment[][src]

#[non_exhaustive]pub enum Environment {
    Unknown,
    GNU,
    GNUABIN32,
    GNUABI64,
    GNUEABI,
    GNUEABIHF,
    GNUX32,
    CODE16,
    EABI,
    EABIHF,
    Android,
    Musl,
    MuslEABI,
    MuslEABIHF,
    MSVC,
    Itanium,
    Cygnus,
    CoreCLR,
    Simulator,
    MacABI,
    PhantomStandard,
    PhantomKernel,
}

The Environment field of target tuples

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unknown
GNU
GNUABIN32
GNUABI64
GNUEABI
GNUEABIHF
GNUX32
CODE16
EABI
EABIHF
Android
Musl
MuslEABI
MuslEABIHF
MSVC
Itanium
Cygnus
CoreCLR
Simulator
MacABI
PhantomStandard
PhantomKernel

Implementations

impl Environment[src]

pub fn parse(s: &str) -> Self[src]

Parses the Environment name in a "lossy" manner This is equivalent to Self::from_str, except that Environment::Unknown is returned, instead of an error, on an unknown OS Field

Example

    use target_tuples::Environment;
    let env = Environment::parse("gnu");
    assert_eq!(env,Environment::GNU);
    let env2: Environment = "gnu".parse().unwrap();
    assert_eq!(env,env2);

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

Returns the canonical name of the environment The canonical name, when passed into Self::parse will yield an equivalent value, Formatting an Environment yields this string

Examples

   use target_tuples::Environment;
   let os = Environment::Musl;
   assert_eq!(Environment::parse(os.canonical_name()),os);

Trait Implementations

impl Clone for Environment[src]

impl Copy for Environment[src]

impl Debug for Environment[src]

impl Display for Environment[src]

impl Eq for Environment[src]

impl FromStr for Environment[src]

type Err = UnknownError

The associated error which can be returned from parsing.

impl PartialEq<Environment> for Environment[src]

impl StructuralEq for Environment[src]

impl StructuralPartialEq for Environment[src]

Auto Trait Implementations

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

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.