Struct CargoBuilder

Source
pub struct CargoBuilder { /* private fields */ }
Expand description

A builder-pattern which constructs a command to invoke cargo build

Implementations§

Source§

impl CargoBuilder

Source

pub fn new(env: &Environment, working_dir: &Path, clean_env: bool) -> Self

Construct a new builder instance to run cargo in the given directory.

If clean_env is set, cargo configuration variables will not be passed through from the command.

Source

pub fn construct(&mut self) -> Command

Constructs the command which will execute cargo

Source

pub fn cargo_path(&mut self, cargo: &Path) -> &mut Self

Set the path to the cargo executable

Source

pub fn home(&mut self, home: &Path) -> &mut Self

Set the CARGO_HOME variable for invoking cargo

Source

pub fn target_dir(&mut self, target_dir: &Path) -> &mut Self

Set the CARGO_TARGET_DIR variable for invoking cargo

Source

pub fn rustc(&mut self, rustc: &Path) -> &mut Self

Set the RUSTC variable for invoking cargo

Source

pub fn rustc_wrapper(&mut self, rustc_wrapper: &Path) -> &mut Self

Set the RUSTC_WRAPPER variable for invoking cargo

Source

pub fn rustdoc(&mut self, rustdoc: &Path) -> &mut Self

Set the RUSTDOC variable when invoking cargo

Source

pub fn add_rustdoc_flag(&mut self, rustdoc_flag: &str) -> &mut Self

Add an item to the RUSTDOCFLAGS environment string

Source

pub fn add_rustdoc_flags(&mut self, rustdoc_flags: &[&str]) -> &mut Self

Add multiple items to the RUSTDOCFLAGS environment string

Source

pub fn add_rust_flag(&mut self, rust_flag: &str) -> &mut Self

Add an item to the RUSTFLAGS environment string

Source

pub fn add_rust_flags(&mut self, rust_flags: &[&str]) -> &mut Self

Add multiple items to the RUSTFLAGS environment string

Source

pub fn incremental(&mut self, incremental: bool) -> &mut Self

Explicitly set whether incremental builds are enabled or disabled

Source

pub fn cache_rustc_info(&mut self, cache_rustc_info: bool) -> &mut Self

Enable/disable whether or not cargo should cache rust info

Source

pub fn term(&mut self, term: &str) -> &mut Self

Set the terminal environment variable.

Source

pub fn build_jobs(&mut self, build_jobs: u64) -> &mut Self

Override the build.jobs configuration option

Source

pub fn target(&mut self, target: &str) -> &mut Self

Override the build.target configuration option

Source

pub fn dep_info_basedir(&mut self, dep_info_basedir: &Path) -> &mut Self

Override the build.dep-info-basedir configuration option

Source

pub fn pipelining(&mut self, pipelining: bool) -> &mut Self

Override the build.pipelining configuration option

Source

pub fn http_debug(&mut self, http_debug: bool) -> &mut Self

Override the http.debug configuration option

Source

pub fn http_proxy(&mut self, http_proxy: &str) -> &mut Self

Override the http.proxy configuration option

Source

pub fn http_timeout(&mut self, http_timeout: Duration) -> &mut Self

Override the http.debug configuration option

Source

pub fn http_cainfo(&mut self, http_cainfo: &Path) -> &mut Self

Override the http.cainfo file configuration option

Source

pub fn http_check_revoke(&mut self, http_check_revoke: bool) -> &mut Self

Override the http.check-revoke configuration option

Source

pub fn http_ssl_version(&mut self, http_ssl_version: &str) -> &mut Self

Override the http.ssl-version configuration option

Source

pub fn http_low_speed_limit(&mut self, http_low_speed_limit: u64) -> &mut Self

Override the http.low-speed-limit configuration option

Source

pub fn http_multiplexing(&mut self, http_multiplexing: bool) -> &mut Self

Override the http.multiplexing configuration option

Source

pub fn http_user_agent(&mut self, http_user_agent: String) -> &mut Self

Override the http.user-agent configuration option

Source

pub fn net_retry(&mut self, net_retry: u64) -> &mut Self

Override the net.retry configuration option

Source

pub fn net_git_fetch_with_cli( &mut self, net_git_fetch_with_cli: bool, ) -> &mut Self

Override the net.get_fetch_with_cli configuration option

Source

pub fn net_offline(&mut self, net_offline: bool) -> &mut Self

Override the net.offline configuration option

Source

pub fn add_registry(&mut self, name: String, index: Url) -> &mut Self

Add a new crates.io-style registry to this invocation of cargo

Source

pub fn term_verbose(&mut self, term_verbose: bool) -> &mut Self

Sets whether to use verbose stdout in the cargo run

Source

pub fn term_color(&mut self, term_color: bool) -> &mut Self

Sets whether to output terminal colors

Source

pub fn profile(&mut self, profile: String) -> &mut Self

Override the inherited profile (i.e. --release)

Source

pub fn locked(&mut self, locked: bool) -> &mut Self

Override the inherited locked argument (i.e. --locked)

Trait Implementations§

Source§

impl Clone for CargoBuilder

Source§

fn clone(&self) -> CargoBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CargoBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,