Struct cargo::core::compiler::CompileTarget[][src]

pub struct CompileTarget { /* fields omitted */ }

Abstraction for the representation of a compilation target that Cargo has.

Compilation targets are one of two things right now:

  1. A raw target string, like x86_64-unknown-linux-gnu.
  2. The path to a JSON file, such as /path/to/my-target.json.

Raw target strings are typically dictated by rustc itself and represent built-in targets. Custom JSON files are somewhat unstable, but supported here in Cargo. Note that for JSON target files this CompileTarget stores a full canonicalized path to the target.

The main reason for this existence is to handle JSON target files where when we call rustc we pass full paths but when we use it for Cargo’s purposes like naming directories or looking up configuration keys we only check the file stem of JSON target files. For built-in rustc targets this is just an uninterpreted string basically.

Implementations

impl CompileTarget[src]

pub fn new(name: &str) -> CargoResult<CompileTarget>[src]

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

Returns the full unqualified name of this target, suitable for passing to rustc directly.

Typically this is pretty much the same as short_name, but for the case of JSON target files this will be a full canonicalized path name for the current filesystem.

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

Returns a “short” version of the target name suitable for usage within Cargo for configuration and such.

This is typically the same as rustc_target, or the full name, but for JSON target files this returns just the file stem (e.g. foo out of foo.json) instead of the full path.

Trait Implementations

impl Clone for CompileTarget[src]

impl Copy for CompileTarget[src]

impl Debug for CompileTarget[src]

impl Eq for CompileTarget[src]

impl Hash for CompileTarget[src]

impl Ord for CompileTarget[src]

impl PartialEq<CompileTarget> for CompileTarget[src]

impl PartialOrd<CompileTarget> for CompileTarget[src]

impl Serialize for CompileTarget[src]

impl StructuralEq for CompileTarget[src]

impl StructuralPartialEq for CompileTarget[src]

Auto Trait Implementations

impl RefUnwindSafe for CompileTarget

impl Send for CompileTarget

impl Sync for CompileTarget

impl Unpin for CompileTarget

impl UnwindSafe for CompileTarget

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> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]