pub struct RunningCommand { /* private fields */ }Expand description
Live child process with optional piped stdio.
Implementations§
Source§impl RunningCommand
impl RunningCommand
Sourcepub fn from_system(
child: Child,
stdin: Option<ChildStdin>,
stdout: Option<ChildStdout>,
stderr: Option<ChildStderr>,
) -> Self
pub fn from_system( child: Child, stdin: Option<ChildStdin>, stdout: Option<ChildStdout>, stderr: Option<ChildStderr>, ) -> Self
Build a handle from a spawned OS child and taken stdio pipes.
Sourcepub fn from_recording(
exit: CommandExit,
stdout: Option<Vec<u8>>,
stderr: Vec<u8>,
piped_stdin: bool,
) -> Self
pub fn from_recording( exit: CommandExit, stdout: Option<Vec<u8>>, stderr: Vec<u8>, piped_stdin: bool, ) -> Self
Build a synthetic handle for tests and custom CommandRunner implementations.
Sourcepub fn stdin_mut(&mut self) -> Option<&mut dyn Write>
pub fn stdin_mut(&mut self) -> Option<&mut dyn Write>
Writable stdin when the spec requested a pipe.
Sourcepub fn close_stdin(&mut self)
pub fn close_stdin(&mut self)
Close the stdin pipe so the child sees EOF (required after writing hook/filter stdin).
Sourcepub fn stdout_mut(&mut self) -> Option<&mut dyn Read>
pub fn stdout_mut(&mut self) -> Option<&mut dyn Read>
Readable stdout when the spec requested a pipe.
Sourcepub fn wait(self) -> Result<CommandExit>
pub fn wait(self) -> Result<CommandExit>
Sourcepub fn wait_with_output(self) -> Result<CommandOutput>
pub fn wait_with_output(self) -> Result<CommandOutput>
Sourcepub fn into_child(self) -> Result<Child, CommandHandleError>
pub fn into_child(self) -> Result<Child, CommandHandleError>
Underlying OS child for long-running filters (system runner only).
§Errors
Returns CommandHandleError when the handle is not backed by a live process.
Sourcepub fn into_system_parts(
self,
) -> Result<(Child, Option<ChildStdin>, Option<ChildStdout>, Option<ChildStderr>), CommandHandleError>
pub fn into_system_parts( self, ) -> Result<(Child, Option<ChildStdin>, Option<ChildStdout>, Option<ChildStderr>), CommandHandleError>
Split into OS child and taken stdio (system runner only).
§Errors
Returns CommandHandleError when the handle is not backed by a live process.
Auto Trait Implementations§
impl Freeze for RunningCommand
impl RefUnwindSafe for RunningCommand
impl Send for RunningCommand
impl Sync for RunningCommand
impl Unpin for RunningCommand
impl UnsafeUnpin for RunningCommand
impl UnwindSafe for RunningCommand
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