Struct CargoCommandBuilder

Source
pub struct CargoCommandBuilder {
Show 15 fields pub manifest_path: PathBuf, pub args: Vec<String>, pub subcommand: String, pub pid: Option<u32>, pub alternate_cmd: Option<String>, pub execution_dir: Option<PathBuf>, pub suppressed_flags: HashSet<String>, pub stdout_dispatcher: Option<Arc<EventDispatcher>>, pub stderr_dispatcher: Option<Arc<EventDispatcher>>, pub progress_dispatcher: Option<Arc<EventDispatcher>>, pub stage_dispatcher: Option<Arc<EventDispatcher>>, pub terminal_error_flag: Arc<Mutex<bool>>, pub sender: Option<Arc<Mutex<Sender<TerminalError>>>>, pub diagnostics: Arc<Mutex<Vec<CargoDiagnostic>>>, pub is_filter: bool,
}
Expand description

A builder that constructs a Cargo command for a given target.

Fields§

§manifest_path: PathBuf§args: Vec<String>§subcommand: String§pid: Option<u32>§alternate_cmd: Option<String>§execution_dir: Option<PathBuf>§suppressed_flags: HashSet<String>§stdout_dispatcher: Option<Arc<EventDispatcher>>§stderr_dispatcher: Option<Arc<EventDispatcher>>§progress_dispatcher: Option<Arc<EventDispatcher>>§stage_dispatcher: Option<Arc<EventDispatcher>>§terminal_error_flag: Arc<Mutex<bool>>§sender: Option<Arc<Mutex<Sender<TerminalError>>>>§diagnostics: Arc<Mutex<Vec<CargoDiagnostic>>>§is_filter: bool

Implementations§

Source§

impl CargoCommandBuilder

Source

pub fn new(manifest: &PathBuf, subcommand: &str, is_filter: bool) -> Self

Creates a new, empty builder.

Source

pub fn run<F>(self: Arc<Self>, on_spawn: F) -> Result<u32>

Source

pub fn wait(self: Arc<Self>, pid: Option<u32>) -> Result<CargoProcessResult>

Source

pub fn with_target(self, target: &CargoTarget) -> Self

Configure the command based on the target kind.

Source

pub fn with_cli(self, cli: &Cli) -> Self

Configure the command using CLI options.

Source

pub fn with_required_features( self, manifest: &PathBuf, target: &CargoTarget, ) -> Self

Append required features based on the manifest, target kind, and name. This method queries your manifest helper function and, if features are found, appends “–features” and the feature list.

Source

pub fn with_extra_args(self, extra: &[String]) -> Self

Appends extra arguments to the command.

Source

pub fn build(self) -> Vec<String>

Builds the final vector of command-line arguments.

Source

pub fn build_command(&self) -> Command

Optionally, builds a std::process::Command.

Trait Implementations§

Source§

impl Clone for CargoCommandBuilder

Source§

fn clone(&self) -> CargoCommandBuilder

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

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

Performs copy-assignment from source. Read more
Source§

impl Default for CargoCommandBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> MaybeSendSync for T