pub struct CommandTrace<'a> { /* private fields */ }
Implementations§
Source§impl<'a> CommandTrace<'a>
impl<'a> CommandTrace<'a>
Sourcepub fn builder() -> CommandTraceBuilder<'a, ((), (), (), (), (), (), ())>
pub fn builder() -> CommandTraceBuilder<'a, ((), (), (), (), (), (), ())>
Create a builder for building CommandTrace
.
On the builder, call .command(...)
, .args(...)
(optional), .envs(...)
(optional), .current_dir(...)
(optional), .status(...)
(optional), .stdout(...)
(optional), .stderr(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of CommandTrace
.
Source§impl<'a> CommandTrace<'a>
impl<'a> CommandTrace<'a>
pub fn trace_args<L>(&'a mut self, filter: L) -> &'a mut CommandTrace<'_>
pub fn trace_envs<L>(&'a mut self, filter: L) -> &'a mut CommandTrace<'_>
pub fn trace_current_dir<L>(&'a mut self, filter: L) -> &'a mut CommandTrace<'_>
pub fn trace_status<L>(&'a mut self, filter: L) -> &'a mut CommandTrace<'_>
pub fn trace_stdout<L>(&'a mut self, filter: L) -> &'a mut CommandTrace<'_>
pub fn trace_stderr<L>(&'a mut self, filter: L) -> &'a mut CommandTrace<'_>
Trait Implementations§
Source§impl<'a> CommandExtCheck for CommandTrace<'a>
impl<'a> CommandExtCheck for CommandTrace<'a>
Source§impl<'a> CommandWrap for CommandTrace<'a>
impl<'a> CommandWrap for CommandTrace<'a>
Source§fn after_output(&mut self, output: &Result<Output>)
fn after_output(&mut self, output: &Result<Output>)
Called when output is created using [
output
]Source§fn after_status(&mut self, status: &Result<ExitStatus>)
fn after_status(&mut self, status: &Result<ExitStatus>)
Called when status is obtained using [
status
]Source§fn on_env<K, V>(&mut self, key: K, val: V)
fn on_env<K, V>(&mut self, key: K, val: V)
Called when environment variables are configured using
env
Source§fn on_envs<'a, I, K, V>(&mut self, vars: I)
fn on_envs<'a, I, K, V>(&mut self, vars: I)
Called when environment variables are configured using [
envs
]Source§fn on_env_remove<K: AsRef<OsStr>>(&mut self, key: K)
fn on_env_remove<K: AsRef<OsStr>>(&mut self, key: K)
Called when environment variables are removed using [
env_remove
]Source§fn on_env_clear(&mut self)
fn on_env_clear(&mut self)
Called when environment variables are cleared using [
env_clear
]Source§fn on_current_dir<P: AsRef<Path>>(&mut self, dir: P)
fn on_current_dir<P: AsRef<Path>>(&mut self, dir: P)
Called when the current directory is set using [
current_dir
]Source§fn after_spawn(&mut self, child: &Result<Child>)
fn after_spawn(&mut self, child: &Result<Child>)
Called when the child process is spawned using [
spawn
]Source§fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
Adds an argument to pass to the program. Read more
Source§fn args<I, S>(&mut self, args: I) -> &mut Self
fn args<I, S>(&mut self, args: I) -> &mut Self
Adds multiple arguments to pass to the program. Read more
Source§fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
Inserts or updates an explicit environment variable mapping. Read more
Source§fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
Inserts or updates multiple explicit environment variable mappings. Read more
Source§fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Self
fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Self
Removes an explicitly set environment variable and prevents inheriting it from a parent
process. Read more
Source§fn env_clear(&mut self) -> &mut Self
fn env_clear(&mut self) -> &mut Self
Clears all explicitly set environment variables and prevents inheriting any parent process
environment variables. Read more
Source§fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
Sets the working directory for the child process. Read more
Source§fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
Configuration for the child process’s standard input (stdin) handle. Read more
Source§fn stdout<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
fn stdout<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
Configuration for the child process’s standard output (stdout) handle. Read more
Source§fn stderr<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
fn stderr<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
Configuration for the child process’s standard error (stderr) handle. Read more
Source§fn spawn(&mut self) -> Result<Child>
fn spawn(&mut self) -> Result<Child>
Executes the command as a child process, returning a handle to it. Read more
Source§fn output(&mut self) -> Result<Output>
fn output(&mut self) -> Result<Output>
Executes the command as a child process, waiting for it to finish and
collecting all of its output. Read more
Source§fn status(&mut self) -> Result<ExitStatus>
fn status(&mut self) -> Result<ExitStatus>
Executes a command as a child process, waiting for it to finish and
collecting its status. Read more
Source§fn get_program(&self) -> &OsStr
fn get_program(&self) -> &OsStr
Returns the path to the program that was given to
Command::new
. Read moreSource§fn get_args(&self) -> CommandArgs<'_>
fn get_args(&self) -> CommandArgs<'_>
Returns an iterator of the arguments that will be passed to the program. Read more
Source§fn get_envs(&self) -> CommandEnvs<'_>
fn get_envs(&self) -> CommandEnvs<'_>
Returns an iterator of the environment variables explicitly set for the child process. Read more
Source§impl<'a> Debug for CommandTrace<'a>
impl<'a> Debug for CommandTrace<'a>
Source§impl<'a> From<&'a mut Command> for CommandTrace<'a>
impl<'a> From<&'a mut Command> for CommandTrace<'a>
Source§impl<'a> HasCommand for CommandTrace<'a>
impl<'a> HasCommand for CommandTrace<'a>
Auto Trait Implementations§
impl<'a> Freeze for CommandTrace<'a>
impl<'a> !RefUnwindSafe for CommandTrace<'a>
impl<'a> Send for CommandTrace<'a>
impl<'a> Sync for CommandTrace<'a>
impl<'a> Unpin for CommandTrace<'a>
impl<'a> !UnwindSafe for CommandTrace<'a>
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
Mutably borrows from an owned value. Read more