[][src]Trait cargo::core::compiler::Executor

pub trait Executor: Send + Sync + 'static {
    fn init(&self, _cx: &Context, _unit: &Unit) { ... }
fn exec(
        &self,
        cmd: ProcessBuilder,
        _id: PackageId,
        _target: &Target,
        _mode: CompileMode
    ) -> CargoResult<()> { ... }
fn exec_and_capture_output(
        &self,
        cmd: ProcessBuilder,
        id: PackageId,
        target: &Target,
        mode: CompileMode,
        _state: &JobState
    ) -> CargoResult<()> { ... }
fn exec_json(
        &self,
        cmd: ProcessBuilder,
        _id: PackageId,
        _target: &Target,
        _mode: CompileMode,
        handle_stdout: &mut dyn FnMut(&str) -> CargoResult<()>,
        handle_stderr: &mut dyn FnMut(&str) -> CargoResult<()>
    ) -> CargoResult<()> { ... }
fn force_rebuild(&self, _unit: &Unit) -> bool { ... } }

A glorified callback for executing calls to rustc. Rather than calling rustc directly, we'll use an Executor, giving clients an opportunity to intercept the build calls.

Provided methods

fn init(&self, _cx: &Context, _unit: &Unit)

Called after a rustc process invocation is prepared up-front for a given unit of work (may still be modified for runtime-known dependencies, when the work is actually executed).

fn exec(
    &self,
    cmd: ProcessBuilder,
    _id: PackageId,
    _target: &Target,
    _mode: CompileMode
) -> CargoResult<()>

In case of an Err, Cargo will not continue with the build process for this package.

fn exec_and_capture_output(
    &self,
    cmd: ProcessBuilder,
    id: PackageId,
    target: &Target,
    mode: CompileMode,
    _state: &JobState
) -> CargoResult<()>

fn exec_json(
    &self,
    cmd: ProcessBuilder,
    _id: PackageId,
    _target: &Target,
    _mode: CompileMode,
    handle_stdout: &mut dyn FnMut(&str) -> CargoResult<()>,
    handle_stderr: &mut dyn FnMut(&str) -> CargoResult<()>
) -> CargoResult<()>

fn force_rebuild(&self, _unit: &Unit) -> bool

Queried when queuing each unit of work. If it returns true, then the unit will always be rebuilt, independent of whether it needs to be.

Loading content...

Implementors

impl Executor for DefaultExecutor[src]

fn init(&self, _cx: &Context, _unit: &Unit)[src]

fn exec(
    &self,
    cmd: ProcessBuilder,
    _id: PackageId,
    _target: &Target,
    _mode: CompileMode
) -> CargoResult<()>
[src]

fn exec_json(
    &self,
    cmd: ProcessBuilder,
    _id: PackageId,
    _target: &Target,
    _mode: CompileMode,
    handle_stdout: &mut dyn FnMut(&str) -> CargoResult<()>,
    handle_stderr: &mut dyn FnMut(&str) -> CargoResult<()>
) -> CargoResult<()>
[src]

fn force_rebuild(&self, _unit: &Unit) -> bool[src]

Loading content...