[−][src]Struct cargo::core::compiler::Unit
All information needed to define a Unit.
A unit is an object that has enough information so that cargo knows how to build it.
For example, if your package has dependencies, then every dependency will be built as a library
unit. If your package is a library, then it will be built as a library unit as well, or if it
is a binary with main.rs
, then a binary will be output. There are also separate unit types
for test
ing and check
ing, amongst others.
The unit also holds information about all possible metadata about the package in pkg
.
A unit needs to know extra information in addition to the type and root source file. For example, it needs to know the target architecture (OS, chip arch etc.) and it needs to know whether you want a debug or release build. There is enough information in this struct to figure all that out.
Fields
pkg: &'a Package
Information about available targets, which files to include/exclude, etc. Basically stuff in
Cargo.toml
.
target: &'a Target
Information about the specific target to build, out of the possible targets in pkg
. Not
to be confused with target-triple (or target architecture ...), the target arch for a
build.
profile: Profile
The profile contains information about how the build should be run, including debug level, etc.
kind: Kind
Whether this compilation unit is for the host or target architecture.
For example, when cross compiling and using a custom build script, the build script needs to be compiled for the host architecture so the host rustc can use it (when compiling to the target architecture).
mode: CompileMode
The "mode" this unit is being compiled for. See CompileMode
for
more details.
Methods
impl<'a> Unit<'a>
[src]
Trait Implementations
impl<'a> PartialOrd<Unit<'a>> for Unit<'a>
[src]
fn partial_cmp(&self, other: &Unit<'a>) -> Option<Ordering>
[src]
fn lt(&self, other: &Unit<'a>) -> bool
[src]
fn le(&self, other: &Unit<'a>) -> bool
[src]
fn gt(&self, other: &Unit<'a>) -> bool
[src]
fn ge(&self, other: &Unit<'a>) -> bool
[src]
impl<'a> Copy for Unit<'a>
[src]
impl<'a> PartialEq<Unit<'a>> for Unit<'a>
[src]
impl<'a> Clone for Unit<'a>
[src]
fn clone(&self) -> Unit<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Ord for Unit<'a>
[src]
fn cmp(&self, other: &Unit<'a>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<'a> Eq for Unit<'a>
[src]
impl<'a> Debug for Unit<'a>
[src]
impl<'a> Hash for Unit<'a>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self