pub struct OsSubprocessRuntime { /* private fields */ }Expand description
Default implementation using std::process::Command.
Implementations§
Source§impl OsSubprocessRuntime
impl OsSubprocessRuntime
Sourcepub fn with_timeout(timeout_secs: u64) -> Self
pub fn with_timeout(timeout_secs: u64) -> Self
Create a new OS subprocess runtime with the given wall-clock timeout.
If the subprocess does not complete within timeout_secs seconds the
call returns a SubprocessError with a “timed out” message and attempts
to terminate the spawned process before returning.
§Stdin size caveat
Stdin data is written synchronously before the timeout poll loop begins.
If the subprocess hangs before consuming stdin and the data exceeds the
OS pipe buffer (~64 KiB on Linux), run_command will block in the write
phase and the timeout will not fire. For typical Perl source files this
is not a concern.
§Panics
Panics if timeout_secs is zero (a zero-second timeout would time out
every command immediately and is almost certainly a caller bug).
Trait Implementations§
Source§impl Default for OsSubprocessRuntime
impl Default for OsSubprocessRuntime
Source§impl SubprocessRuntime for OsSubprocessRuntime
impl SubprocessRuntime for OsSubprocessRuntime
Source§fn run_command(
&self,
program: &str,
args: &[&str],
stdin: Option<&[u8]>,
) -> Result<SubprocessOutput, SubprocessError>
fn run_command( &self, program: &str, args: &[&str], stdin: Option<&[u8]>, ) -> Result<SubprocessOutput, SubprocessError>
Execute a command with the given arguments and optional stdin.
Auto Trait Implementations§
impl Freeze for OsSubprocessRuntime
impl RefUnwindSafe for OsSubprocessRuntime
impl Send for OsSubprocessRuntime
impl Sync for OsSubprocessRuntime
impl Unpin for OsSubprocessRuntime
impl UnsafeUnpin for OsSubprocessRuntime
impl UnwindSafe for OsSubprocessRuntime
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