pub struct Command<'a> { /* private fields */ }Expand description
Builds a process to spawn, relaying stdio across VFS domains when a given endpoint cannot be consumed directly by the spawn target.
Implementations§
Source§impl<'a> Command<'a>
impl<'a> Command<'a>
Sourcepub fn env(&mut self, key: &str, val: &str) -> &mut Self
pub fn env(&mut self, key: &str, val: &str) -> &mut Self
Sets an environment variable for the child.
Sourcepub fn env_remove(&mut self, key: &str) -> &mut Self
pub fn env_remove(&mut self, key: &str) -> &mut Self
Removes an environment variable from the child.
Sourcepub fn current_dir(&mut self, dir: Path<'_>) -> &mut Self
pub fn current_dir(&mut self, dir: Path<'_>) -> &mut Self
Sets the child’s working directory.
Sourcepub fn stdin(&mut self, stdio: StdioRecv) -> Result<&mut Self>
pub fn stdin(&mut self, stdio: StdioRecv) -> Result<&mut Self>
Sets the child’s standard input.
Sourcepub fn stdout(&mut self, stdio: StdioSend) -> Result<&mut Self>
pub fn stdout(&mut self, stdio: StdioSend) -> Result<&mut Self>
Sets the child’s standard output.
Sourcepub fn stdin_inherit(&mut self) -> Result<&mut Self>
pub fn stdin_inherit(&mut self) -> Result<&mut Self>
Inherit the host process’s standard input.
Opaque remote clients treat terminal input as null because Tokio cannot cancel an outstanding terminal read. Redirected input is relayed to the remote process.
Sourcepub fn stdout_inherit(&mut self) -> Result<&mut Self>
pub fn stdout_inherit(&mut self) -> Result<&mut Self>
Inherits the host process’s standard output.
Sourcepub fn stdout_inherit_stderr(&mut self) -> Result<&mut Self>
pub fn stdout_inherit_stderr(&mut self) -> Result<&mut Self>
Connects the child’s standard output to the parent process’s standard error.
Sourcepub fn stdin_null(&mut self) -> &mut Self
pub fn stdin_null(&mut self) -> &mut Self
Connects the child’s standard input to the null device.
Sourcepub fn stdout_null(&mut self) -> &mut Self
pub fn stdout_null(&mut self) -> &mut Self
Connects the child’s standard output to the null device.
Sourcepub fn stderr(&mut self, stdio: StdioSend) -> Result<&mut Self>
pub fn stderr(&mut self, stdio: StdioSend) -> Result<&mut Self>
Sets the child’s standard error.
Sourcepub fn stderr_inherit(&mut self) -> Result<&mut Self>
pub fn stderr_inherit(&mut self) -> Result<&mut Self>
Inherits the host process’s standard error.
Sourcepub fn stderr_to_stdout(&mut self) -> Result<&mut Self>
pub fn stderr_to_stdout(&mut self) -> Result<&mut Self>
Connects the child’s standard error to the same destination as its configured standard output.
Sourcepub fn stderr_inherit_stdout(&mut self) -> Result<&mut Self>
pub fn stderr_inherit_stdout(&mut self) -> Result<&mut Self>
Connects the child’s standard error to the parent process’s standard output.
Sourcepub fn stderr_null(&mut self) -> &mut Self
pub fn stderr_null(&mut self) -> &mut Self
Connects the child’s standard error to the null device.
Sourcepub fn process_control(&mut self, control: ProcessControl) -> &mut Self
pub fn process_control(&mut self, control: ProcessControl) -> &mut Self
Sets foreground or background process control behavior.
Sourcepub fn termination_policy(&mut self, policy: TerminationPolicy) -> &mut Self
pub fn termination_policy(&mut self, policy: TerminationPolicy) -> &mut Self
Sets the policy used to terminate the child.
Auto Trait Implementations§
impl<'a> !Freeze for Command<'a>
impl<'a> !RefUnwindSafe for Command<'a>
impl<'a> !UnwindSafe for Command<'a>
impl<'a> Send for Command<'a>
impl<'a> Sync for Command<'a>
impl<'a> Unpin for Command<'a>
impl<'a> UnsafeUnpin for Command<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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