Enum target_tuples::OS[][src]

#[non_exhaustive]pub enum OS {
    Unknown,
    Ananas,
    CloudABI,
    Darwin,
    DragonFly,
    FreeBSD,
    Fuchsia,
    IOS,
    KFreeBSD,
    Linux,
    Lv2,
    MacOSX,
    NetBSD,
    OpenBSD,
    Solaris,
    Win32,
    ZOS,
    Haiku,
    Minix,
    RTEMS,
    NaCl,
    AIX,
    CUDA,
    NVCL,
    AMDHSA,
    PS4,
    ELFIAMCU,
    TvOS,
    WatchOS,
    Mesa3D,
    Contiki,
    AMDPAL,
    HermitCore,
    Hurd,
    WASI,
    Emscripten,
    PhantomOS,
}

The Operating System Field of a target tuple

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
Ananas
CloudABI
Darwin
DragonFly
FreeBSD
Fuchsia
IOS
KFreeBSD
Linux
Lv2
MacOSX
NetBSD
OpenBSD
Solaris
Win32
ZOS
Haiku
Minix
RTEMS
NaCl
AIX
CUDA
NVCL
AMDHSA
PS4
ELFIAMCU
TvOS
WatchOS
Mesa3D
Contiki
AMDPAL
HermitCore
Hurd
WASI
Emscripten
PhantomOS

Implementations

impl OS[src]

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

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

Example

    use target_tuples::OS;
    let os = OS::parse("linux");
    assert_eq!(os,OS::Linux);
    let os2: OS = "linux".parse().unwrap();
    assert_eq!(os,os2);

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

Returns the canonical name of the operating system The canonical name, when passed into [Self::parse`] will yield an equivalent value, Formatting an OS yields this string

Examples

   use target_tuples::OS;
   let os = OS::PS4;
   assert_eq!(OS::parse(os.canonical_name()),os);

Trait Implementations

impl Clone for OS[src]

impl Copy for OS[src]

impl Debug for OS[src]

impl Display for OS[src]

impl Eq for OS[src]

impl FromStr for OS[src]

type Err = UnknownError

The associated error which can be returned from parsing.

impl PartialEq<OS> for OS[src]

impl StructuralEq for OS[src]

impl StructuralPartialEq for OS[src]

Auto Trait Implementations

impl RefUnwindSafe for OS[src]

impl Send for OS[src]

impl Sync for OS[src]

impl Unpin for OS[src]

impl UnwindSafe for OS[src]

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.