pub struct ExecOptions {
pub cwd: Option<PathBuf>,
pub root: Option<PathBuf>,
pub timeout_ms: u64,
pub max_output_bytes: usize,
pub stdin: Option<Vec<u8>>,
}Expand description
Bounded process execution options.
Fields§
§cwd: Option<PathBuf>Directory the child runs in.
When set, the directory must canonicalize inside root.
root: Option<PathBuf>Root that confines cwd.
When cwd is set and this is absent, the current process directory is
the confinement root. When this is set and cwd is absent, the child
runs in this root directory.
timeout_ms: u64Mandatory timeout in milliseconds. Zero is rejected before spawning.
max_output_bytes: usizeMaximum total captured stdout plus stderr bytes.
stdin: Option<Vec<u8>>Optional stdin bytes written to the child.
Implementations§
Source§impl ExecOptions
impl ExecOptions
Sourcepub fn new(timeout_ms: u64, max_output_bytes: usize) -> Self
pub fn new(timeout_ms: u64, max_output_bytes: usize) -> Self
Builds process options with a timeout and output cap.
Sourcepub fn with_cwd(self, cwd: impl Into<PathBuf>, root: impl Into<PathBuf>) -> Self
pub fn with_cwd(self, cwd: impl Into<PathBuf>, root: impl Into<PathBuf>) -> Self
Returns options with a confined working directory.
Sourcepub fn with_stdin(self, stdin: impl Into<Vec<u8>>) -> Self
pub fn with_stdin(self, stdin: impl Into<Vec<u8>>) -> Self
Returns options with stdin bytes.
Trait Implementations§
Source§impl Clone for ExecOptions
impl Clone for ExecOptions
Source§fn clone(&self) -> ExecOptions
fn clone(&self) -> ExecOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecOptions
impl Debug for ExecOptions
impl Eq for ExecOptions
Source§impl PartialEq for ExecOptions
impl PartialEq for ExecOptions
impl StructuralPartialEq for ExecOptions
Auto Trait Implementations§
impl Freeze for ExecOptions
impl RefUnwindSafe for ExecOptions
impl Send for ExecOptions
impl Sync for ExecOptions
impl Unpin for ExecOptions
impl UnsafeUnpin for ExecOptions
impl UnwindSafe for ExecOptions
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