Enum cargo::core::compiler::CompileMode
source · pub enum CompileMode {
Test,
Build,
Check {
test: bool,
},
Bench,
Doc {
deps: bool,
},
Doctest,
Docscrape,
RunCustomBuild,
}Expand description
The general “mode” for what to do.
This is used for two purposes. The commands themselves pass this in to
compile_ws to tell it the general execution strategy. This influences
the default targets selected. The other use is in the Unit struct
to indicate what is being done with a specific target.
Variants§
Test
A target being built for a test.
Build
Building a target with rustc (lib or bin).
Check
Building a target with rustc to emit rmeta metadata only. If
test is true, then it is also compiled with --test to check it like
a test.
Bench
Used to indicate benchmarks should be built. This is not used in
Unit, because it is essentially the same as Test (indicating
--test should be passed to rustc) and by using Test instead it
allows some de-duping of Units to occur.
Doc
A target that will be documented with rustdoc.
If deps is true, then it will also document all dependencies.
Doctest
A target that will be tested with rustdoc.
Docscrape
An example or library that will be scraped for function calls by rustdoc.
RunCustomBuild
A marker for Units that represent the execution of a build.rs script.
Implementations§
source§impl CompileMode
impl CompileMode
sourcepub fn is_doc_test(self) -> bool
pub fn is_doc_test(self) -> bool
Returns true if this a doc test.
sourcepub fn is_doc_scrape(self) -> bool
pub fn is_doc_scrape(self) -> bool
Returns true if this is scraping examples for documentation.
sourcepub fn is_any_test(self) -> bool
pub fn is_any_test(self) -> bool
Returns true if this is any type of test (test, benchmark, doc test, or
check test).
sourcepub fn is_rustc_test(self) -> bool
pub fn is_rustc_test(self) -> bool
Returns true if this is something that passes --test to rustc.
sourcepub fn is_run_custom_build(self) -> bool
pub fn is_run_custom_build(self) -> bool
Returns true if this is the execution of a build.rs script.
sourcepub fn generates_executable(self) -> bool
pub fn generates_executable(self) -> bool
Returns true if this mode may generate an executable.
Note that this also returns true for building libraries, so you also
have to check the target.
Trait Implementations§
source§impl Clone for CompileMode
impl Clone for CompileMode
source§fn clone(&self) -> CompileMode
fn clone(&self) -> CompileMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CompileMode
impl Debug for CompileMode
source§impl Hash for CompileMode
impl Hash for CompileMode
source§impl Ord for CompileMode
impl Ord for CompileMode
source§fn cmp(&self, other: &CompileMode) -> Ordering
fn cmp(&self, other: &CompileMode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<CompileMode> for CompileMode
impl PartialEq<CompileMode> for CompileMode
source§fn eq(&self, other: &CompileMode) -> bool
fn eq(&self, other: &CompileMode) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<CompileMode> for CompileMode
impl PartialOrd<CompileMode> for CompileMode
source§fn partial_cmp(&self, other: &CompileMode) -> Option<Ordering>
fn partial_cmp(&self, other: &CompileMode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for CompileMode
impl Serialize for CompileMode
impl Copy for CompileMode
impl Eq for CompileMode
impl StructuralEq for CompileMode
impl StructuralPartialEq for CompileMode
Auto Trait Implementations§
impl RefUnwindSafe for CompileMode
impl Send for CompileMode
impl Sync for CompileMode
impl Unpin for CompileMode
impl UnwindSafe for CompileMode
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2 bytes
Size for each variant:
Test: 0 bytesBuild: 0 bytesCheck: 1 byteBench: 0 bytesDoc: 1 byteDoctest: 0 bytesDocscrape: 0 bytesRunCustomBuild: 0 bytes