Struct bootstrap::utils::exec::BootstrapCommand
source · pub struct BootstrapCommand {
pub command: Command,
pub failure_behavior: BehaviorOnFailure,
pub output_mode: Option<OutputMode>,
}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::OnlyOutput). If bootstrap uses verbose mode, then it will also print the
command itself in case of failure (OutputMode::All).
If you want to handle the output programmatically, use output_mode(OutputMode::OnlyOnFailure).
Fields§
§command: Command§failure_behavior: BehaviorOnFailure§output_mode: Option<OutputMode>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 output_mode(self, output_mode: OutputMode) -> Self
Trait Implementations§
source§impl Debug for BootstrapCommand
impl Debug for BootstrapCommand
source§impl<'a> From<&'a mut BootstrapCommand> for BootstrapCommand
impl<'a> From<&'a mut BootstrapCommand> for BootstrapCommand
This implementation is temporary, until all Command invocations are migrated to
BootstrapCommand.
source§fn from(command: &'a mut BootstrapCommand) -> Self
fn from(command: &'a mut BootstrapCommand) -> Self
source§impl<'a> From<&'a mut Command> for BootstrapCommand
impl<'a> From<&'a mut Command> for BootstrapCommand
This implementation is temporary, until all Command invocations are migrated to
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