Struct cargo::core::compiler::CompileTarget [−][src]
Abstraction for the representation of a compilation target that Cargo has.
Compilation targets are one of two things right now:
- A raw target string, like
x86_64-unknown-linux-gnu
. - 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]
fn clone(&self) -> CompileTarget
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CompileTarget
[src]
impl Debug for CompileTarget
[src]
impl Eq for CompileTarget
[src]
impl Hash for CompileTarget
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for CompileTarget
[src]
fn cmp(&self, other: &CompileTarget) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<CompileTarget> for CompileTarget
[src]
fn eq(&self, other: &CompileTarget) -> bool
[src]
fn ne(&self, other: &CompileTarget) -> bool
[src]
impl PartialOrd<CompileTarget> for CompileTarget
[src]
fn partial_cmp(&self, other: &CompileTarget) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for CompileTarget
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,