[][src]Struct target_tuples::Target

pub struct Target { /* fields omitted */ }

The representation of a target tuple.

A Target Tuple is of the form arch-vendor-system, where system can be either os-env or simply either os or env (the latter is used in the case of a freestanding target).

There are two types of target tuple: canonical and exact. This type can be used to represent both.

The core::fmt::Display implementation will display the canonical tuple; the function Self::get_name extracts the exact form that was parsed. In any case, if any field, other than vendor, is unknown, or the form is not the one above, the core::str::FromStr implementation will yield an UnknownError.

Implementations

impl Target[src]

pub fn get_name(&self) -> &str[src]

Gets the exact name of the target tuple.

pub fn get_arch_name(&self) -> &str[src]

Returns the architecture name

pub fn get_vendor_name(&self) -> &str[src]

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

Parses a target tuple of the form arch-vendor-system (where system is either os-env, os, or env). If a field is not known, it is left as unknown, and the original value will be available through the exact name.

Panics if s is not of the above form

pub fn get_operating_system(&self) -> OS[src]

Gets the value of the os field, or unknown if the os was omitted

pub fn get_environment(&self) -> Environment[src]

Gets the value of the env field, or unknown if the environment was omitted

pub fn from_components(
    arch: Architecture,
    vendor: Vendor,
    os: Option<OS>,
    env: Option<Environment>,
    objfmt: Option<ObjectFormat>
) -> Self
[src]

Constructs a target tuple in canonical form from the specified components.

pub fn get_object_format(&self) -> ObjectFormat[src]

Gets the object format, either from the end of the env field, or the default for the target

pub fn get_arch(&self) -> Architecture[src]

Gets the value of the Architecture field

pub fn get_vendor(&self) -> Vendor[src]

Gets the value of the vendor field.

Trait Implementations

impl Clone for Target[src]

impl Debug for Target[src]

impl Display for Target[src]

impl FromStr for Target[src]

type Err = UnknownError

The associated error which can be returned from parsing.

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.