#[non_exhaustive]pub struct BoundedRunOptions { /* private fields */ }Expand description
Optional containment policy for run_std_command_bounded_with_options.
The default keeps the established bounded-run behavior. Setting
Self::kill_when_owner_dies asks the host to terminate the launched
command when the process that called the bounded runner dies:
- Linux installs
PR_SET_PDEATHSIGin the child beforeexec, including a parent-race guard. - macOS installs the existing kqueue supervisor before
exec. - Windows reuses the
NativeProcessper-spawn kill-on-close job; it does not create a second job object.
On Linux and macOS this policy guarantees only direct-child termination. Those operating systems do not provide a parent-death primitive that can atomically terminate a process group, so ordinary descendants may outlive their direct parent. Windows Job Object containment covers the whole job. Callers that need Unix tree cleanup must use an application-level supervisor or an explicit tree-containment mechanism.
Implementations§
Source§impl BoundedRunOptions
impl BoundedRunOptions
Sourcepub fn kill_when_owner_dies(self, enabled: bool) -> Self
pub fn kill_when_owner_dies(self, enabled: bool) -> Self
Set whether the bounded runner asks the host to terminate the direct child if its owner exits unexpectedly.
Sourcepub fn nice(self, nice: Option<i32>) -> Self
pub fn nice(self, nice: Option<i32>) -> Self
Set the semantic launch priority for the bounded child.
Sourcepub fn priority(self, priority: ProcessPriority) -> Self
pub fn priority(self, priority: ProcessPriority) -> Self
Select portable scheduling intent for the bounded child.
Trait Implementations§
Source§impl Clone for BoundedRunOptions
impl Clone for BoundedRunOptions
Source§fn clone(&self) -> BoundedRunOptions
fn clone(&self) -> BoundedRunOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BoundedRunOptions
Source§impl Debug for BoundedRunOptions
impl Debug for BoundedRunOptions
Source§impl Default for BoundedRunOptions
impl Default for BoundedRunOptions
Source§fn default() -> BoundedRunOptions
fn default() -> BoundedRunOptions
impl Eq for BoundedRunOptions
Source§impl PartialEq for BoundedRunOptions
impl PartialEq for BoundedRunOptions
impl StructuralPartialEq for BoundedRunOptions
Auto Trait Implementations§
impl Freeze for BoundedRunOptions
impl RefUnwindSafe for BoundedRunOptions
impl Send for BoundedRunOptions
impl Sync for BoundedRunOptions
impl Unpin for BoundedRunOptions
impl UnsafeUnpin for BoundedRunOptions
impl UnwindSafe for BoundedRunOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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