pub struct ContainedProcessGroup { /* private fields */ }Expand description
A group of processes that are killed together when the group is dropped.
On Windows this wraps a Job Object; on Unix it tracks a process-group ID
and sends SIGKILL to the group on drop.
Implementations§
Source§impl ContainedProcessGroup
impl ContainedProcessGroup
Sourcepub fn with_originator(originator: &str) -> Result<Self, Error>
pub fn with_originator(originator: &str) -> Result<Self, Error>
Create a new process group with an originator name.
Sourcepub fn originator(&self) -> Option<&str>
pub fn originator(&self) -> Option<&str>
Returns the originator name, if set.
Sourcepub fn originator_value(&self) -> Option<String>
pub fn originator_value(&self) -> Option<String>
Returns the full originator env var value (TOOL:PID), if set.
Sourcepub fn spawn(&self, command: &mut Command) -> Result<ContainedChild, Error>
pub fn spawn(&self, command: &mut Command) -> Result<ContainedChild, Error>
Spawn a contained child process. The child will be killed when this group is dropped.
Sourcepub fn spawn_detached(
&self,
command: &mut Command,
) -> Result<ContainedChild, Error>
pub fn spawn_detached( &self, command: &mut Command, ) -> Result<ContainedChild, Error>
Spawn a detached child process. The child will survive this group being dropped.
Sourcepub fn spawn_with_containment(
&self,
command: &mut Command,
containment: Containment,
) -> Result<ContainedChild, Error>
pub fn spawn_with_containment( &self, command: &mut Command, containment: Containment, ) -> Result<ContainedChild, Error>
Spawn a child process with the given containment policy.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ContainedProcessGroup
impl RefUnwindSafe for ContainedProcessGroup
impl Send for ContainedProcessGroup
impl Sync for ContainedProcessGroup
impl Unpin for ContainedProcessGroup
impl UnsafeUnpin for ContainedProcessGroup
impl UnwindSafe for ContainedProcessGroup
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