[][src]Enum cargo::util::command_prelude::CompileMode

pub enum CompileMode {
    Test,
    Build,
    Check {
        test: bool,
    },
    Bench,
    Doc {
        deps: bool,
    },
    Doctest,
    RunCustomBuild,
}

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.

Fields of Check

test: bool
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.

Fields of Doc

deps: bool
Doctest

A target that will be tested with rustdoc.

RunCustomBuild

A marker for Units that represent the execution of a build.rs script.

Implementations

impl CompileMode[src]

pub fn is_check(self) -> bool[src]

Returns true if the unit is being checked.

pub fn is_doc(self) -> bool[src]

Returns true if this is generating documentation.

pub fn is_doc_test(self) -> bool[src]

Returns true if this a doc test.

pub fn is_any_test(self) -> bool[src]

Returns true if this is any type of test (test, benchmark, doc test, or check test).

pub fn is_rustc_test(self) -> bool[src]

Returns true if this is something that passes --test to rustc.

pub fn is_run_custom_build(self) -> bool[src]

Returns true if this is the execution of a build.rs script.

pub fn all_modes() -> &'static [CompileMode][src]

List of all modes (currently used by cargo clean -p for computing all possible outputs).

Trait Implementations

impl Clone for CompileMode[src]

impl Copy for CompileMode[src]

impl Debug for CompileMode[src]

impl Eq for CompileMode[src]

impl Hash for CompileMode[src]

impl Ord for CompileMode[src]

impl PartialEq<CompileMode> for CompileMode[src]

impl PartialOrd<CompileMode> for CompileMode[src]

impl Serialize for CompileMode[src]

impl StructuralEq for CompileMode[src]

impl StructuralPartialEq for CompileMode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,