pub enum CompileMode {
Test,
Build,
Check {
test: bool,
},
Bench,
Doc {
deps: bool,
},
Doctest,
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
Fields
test: bool
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
Fields
deps: bool
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
.
RunCustomBuild
A marker for Units that represent the execution of a build.rs
script.
Implementations
sourceimpl 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_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.
Trait Implementations
sourceimpl Clone for CompileMode
impl Clone for CompileMode
sourcefn clone(&self) -> CompileMode
fn clone(&self) -> CompileMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CompileMode
impl Debug for CompileMode
sourceimpl Hash for CompileMode
impl Hash for CompileMode
sourceimpl Ord for CompileMode
impl Ord for CompileMode
sourceimpl PartialEq<CompileMode> for CompileMode
impl PartialEq<CompileMode> for CompileMode
sourcefn eq(&self, other: &CompileMode) -> bool
fn eq(&self, other: &CompileMode) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CompileMode) -> bool
fn ne(&self, other: &CompileMode) -> bool
This method tests for !=
.
sourceimpl PartialOrd<CompileMode> for CompileMode
impl PartialOrd<CompileMode> for CompileMode
sourcefn partial_cmp(&self, other: &CompileMode) -> Option<Ordering>
fn partial_cmp(&self, other: &CompileMode) -> 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
sourceimpl 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
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