pub struct SpawnPolicy {
pub timeout: Option<Duration>,
pub max_output_bytes: usize,
pub env: EnvPolicy,
pub stderr: StderrMode,
pub current_dir: Option<PathBuf>,
}Expand description
The policy a spawn runs under.
Fields§
§timeout: Option<Duration>Wall-clock ceiling. None waits forever — the pre-1.3 behaviour, kept
expressible so a caller has to opt into it rather than get it by
forgetting.
max_output_bytes: usizeMaximum bytes retained per captured stream. Output past the cap is
drained and discarded — never left unread, which would block the child
on a full pipe — and the corresponding *_truncated flag is set.
env: EnvPolicy§stderr: StderrMode§current_dir: Option<PathBuf>Working directory for the child. None inherits ours.
Implementations§
Source§impl SpawnPolicy
impl SpawnPolicy
Sourcepub fn deny_vars<I: IntoIterator<Item = String>>(self, vars: I) -> Self
pub fn deny_vars<I: IntoIterator<Item = String>>(self, vars: I) -> Self
Deny the named variables, ignoring any that are None. The shape the
hosts use: they hold Option<String> for --passphrase-env and
--token-env and want both scrubbed when set.
pub fn timeout(self, timeout: Option<Duration>) -> Self
pub fn stderr(self, mode: StderrMode) -> Self
Trait Implementations§
Source§impl Clone for SpawnPolicy
impl Clone for SpawnPolicy
Source§fn clone(&self) -> SpawnPolicy
fn clone(&self) -> SpawnPolicy
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 SpawnPolicy
impl Debug for SpawnPolicy
Auto Trait Implementations§
impl Freeze for SpawnPolicy
impl RefUnwindSafe for SpawnPolicy
impl Send for SpawnPolicy
impl Sync for SpawnPolicy
impl Unpin for SpawnPolicy
impl UnsafeUnpin for SpawnPolicy
impl UnwindSafe for SpawnPolicy
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