Struct bootstrap::utils::exec::BootstrapCommand
source · pub struct BootstrapCommand {
pub command: Command,
pub failure_behavior: BehaviorOnFailure,
pub stdout: OutputMode,
pub stderr: OutputMode,
pub run_always: bool,
}Expand description
Wrapper around std::process::Command.
By default, the command will exit bootstrap if it fails. If you want to allow failures, use allow_failure. If you want to delay failures until the end of bootstrap, use delay_failure.
By default, the command will print its stdout/stderr to stdout/stderr of bootstrap (OutputMode::Print). If you want to handle the output programmatically, use BootstrapCommand::capture.
Bootstrap will print a debug log to stdout if the command fails and failure is not allowed.
Fields§
§command: Command§failure_behavior: BehaviorOnFailure§stdout: OutputMode§stderr: OutputMode§run_always: boolImplementations§
source§impl BootstrapCommand
impl BootstrapCommand
pub fn new<S: AsRef<OsStr>>(program: S) -> Self
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
pub fn args<I, S>(&mut self, args: I) -> &mut Self
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
pub fn get_envs(&self) -> CommandEnvs<'_>
pub fn get_args(&self) -> CommandArgs<'_>
pub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Self
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
pub fn delay_failure(self) -> Self
pub fn fail_fast(self) -> Self
pub fn allow_failure(self) -> Self
pub fn run_always(&mut self) -> &mut Self
sourcepub fn capture_stdout(self) -> Self
pub fn capture_stdout(self) -> Self
Capture stdout of the command, do not print it.
sourcepub fn run(&mut self, builder: &Build) -> CommandOutput
pub fn run(&mut self, builder: &Build) -> CommandOutput
Run the command, returning its output.
Trait Implementations§
source§impl Debug for BootstrapCommand
impl Debug for BootstrapCommand
source§impl From<Cargo> for BootstrapCommand
impl From<Cargo> for BootstrapCommand
source§fn from(cargo: Cargo) -> BootstrapCommand
fn from(cargo: Cargo) -> BootstrapCommand
Auto Trait Implementations§
impl Freeze for BootstrapCommand
impl !RefUnwindSafe for BootstrapCommand
impl Send for BootstrapCommand
impl Sync for BootstrapCommand
impl Unpin for BootstrapCommand
impl !UnwindSafe for BootstrapCommand
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 216 bytes