pub enum CompileMode {
Test,
Build,
Check {
test: bool,
},
Bench,
Doc {
deps: bool,
json: 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.
if json
is true, the documentation output is in json format.
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 for CompileMode
impl PartialEq for CompileMode
Source§impl PartialOrd for CompileMode
impl PartialOrd for CompileMode
Source§impl Serialize for CompileMode
impl Serialize for CompileMode
impl Copy for CompileMode
impl Eq for CompileMode
impl StructuralPartialEq for CompileMode
Auto Trait Implementations§
impl Freeze for CompileMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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
: 2 bytesBench
: 0 bytesDoc
: 2 bytesDoctest
: 0 bytesDocscrape
: 0 bytesRunCustomBuild
: 0 bytes