pub struct BootstrapCommand {
command: Command,
pub failure_behavior: BehaviorOnFailure,
pub run_always: bool,
drop_bomb: DropBomb,
}
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::run_capture.
Bootstrap will print a debug log to stdout if the command fails and failure is not allowed.
Fields§
§command: Command
§failure_behavior: BehaviorOnFailure
§run_always: bool
§drop_bomb: DropBomb
Implementations§
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 run(&mut self, builder: &Build) -> bool
pub fn run(&mut self, builder: &Build) -> bool
Run the command, while printing stdout and stderr. Returns true if the command has succeeded.
Sourcepub fn run_capture(&mut self, builder: &Build) -> CommandOutput
pub fn run_capture(&mut self, builder: &Build) -> CommandOutput
Run the command, while capturing and returning all its output.
Sourcepub fn run_capture_stdout(&mut self, builder: &Build) -> CommandOutput
pub fn run_capture_stdout(&mut self, builder: &Build) -> CommandOutput
Run the command, while capturing and returning stdout, and printing stderr.
Sourcepub fn as_command_mut(&mut self) -> &mut Command
pub fn as_command_mut(&mut self) -> &mut Command
Provides access to the stdlib Command inside. FIXME: This function should be eventually removed from bootstrap.
Sourcepub fn mark_as_executed(&mut self)
pub fn mark_as_executed(&mut self)
Mark the command as being executed, disarming the drop bomb. If this method is not called before the command is dropped, its drop will panic.
Sourcepub fn get_created_location(&self) -> Location<'static>
pub fn get_created_location(&self) -> Location<'static>
Returns the source code location where this command was created.
Sourcepub fn force_coloring_in_ci(&mut self)
pub fn force_coloring_in_ci(&mut self)
If in a CI environment, forces the command to run with colors.
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: 272 bytes