pub struct Unit { /* private fields */ }
Expand description
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.
Implementations
Trait Implementations
sourceimpl Ord for Unit
impl Ord for Unit
sourceimpl PartialOrd<Unit> for Unit
impl PartialOrd<Unit> for Unit
sourcefn partial_cmp(&self, other: &Unit) -> Option<Ordering>
fn partial_cmp(&self, other: &Unit) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Unit
Auto Trait Implementations
impl RefUnwindSafe for Unit
impl !Send for Unit
impl !Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more