[][src]Enum target_tuples::ObjectFormat

#[non_exhaustive]pub enum ObjectFormat {
    Unknown,
    XCoff,
    Coff,
    Elf,
    Goff,
    MachO,
    Wasm,
}

The object format used by a target

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
XCoff
Coff
Elf
Goff
MachO
Wasm

Implementations

impl ObjectFormat[src]

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

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

Example

    use target_tuples::ObjectFormat;
    let of = ObjectFormat::parse("gnuelf");
    assert_eq!(of,ObjectFormat::Elf);
    let of2: ObjectFormat = "pstdelf".parse().unwrap();
    assert_eq!(of,of2);

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

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

Examples

   use target_tuples::ObjectFormat;
   let os = ObjectFormat::MachO;
   assert_eq!(ObjectFormat::parse(os.canonical_name()),os);

Trait Implementations

impl Clone for ObjectFormat[src]

impl Copy for ObjectFormat[src]

impl Debug for ObjectFormat[src]

impl Display for ObjectFormat[src]

impl Eq for ObjectFormat[src]

impl FromStr for ObjectFormat[src]

type Err = UnknownError

The associated error which can be returned from parsing.

impl PartialEq<ObjectFormat> for ObjectFormat[src]

impl StructuralEq for ObjectFormat[src]

impl StructuralPartialEq for ObjectFormat[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.