pub enum CompileKind {
Host,
Target(CompileTarget),
}Expand description
Indicator for how a unit is being compiled.
This is used primarily for organizing cross compilations vs host
compilations, where cross compilations happen at the request of --target
and host compilations happen for things like build scripts and procedural
macros.
Variants§
Host
Attached to a unit that is compiled for the “host” system or otherwise
is compiled without a --target flag. This is used for procedural
macros and build scripts, or if the --target flag isn’t passed.
Target(CompileTarget)
Attached to a unit to be compiled for a particular target. This is used
for units when the --target flag is passed.
Implementations§
Source§impl CompileKind
impl CompileKind
pub fn is_host(&self) -> bool
pub fn for_target(self, target: &Target) -> CompileKind
Trait Implementations§
Source§impl Clone for CompileKind
impl Clone for CompileKind
Source§fn clone(&self) -> CompileKind
fn clone(&self) -> CompileKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompileKind
impl Debug for CompileKind
Source§impl Hash for CompileKind
impl Hash for CompileKind
Source§impl Ord for CompileKind
impl Ord for CompileKind
Source§fn cmp(&self, other: &CompileKind) -> Ordering
fn cmp(&self, other: &CompileKind) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CompileKind
impl PartialEq for CompileKind
Source§impl PartialOrd for CompileKind
impl PartialOrd for CompileKind
Source§impl Serialize for CompileKind
impl Serialize for CompileKind
impl Copy for CompileKind
impl Eq for CompileKind
impl StructuralPartialEq for CompileKind
Auto Trait Implementations§
impl Freeze for CompileKind
impl RefUnwindSafe for CompileKind
impl Send for CompileKind
impl Sync for CompileKind
impl Unpin for CompileKind
impl UnwindSafe for CompileKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more