pub struct JobObject;Available on Windows and crate feature
job-object and crate feature std only.Expand description
Wrapper which creates a job object context for a Command.
This wrapper is only available on Windows.
It creates a Windows Job Object and associates the Command to it. This behaves analogously
to process groups on Unix or even cgroups on Linux, with the ability to restrict resource use.
See Job Objects.
This wrapper provides a child wrapper: JobObjectChild.
When both CreationFlags and JobObject are used together, either:
CreationFlagsmust come first, orCreationFlagsmust includeCREATE_SUSPENDED
Trait Implementations§
Source§impl CommandWrapper for JobObject
impl CommandWrapper for JobObject
Source§fn pre_spawn(&mut self, command: &mut Command, core: &CommandWrap) -> Result<()>
fn pre_spawn(&mut self, command: &mut Command, core: &CommandWrap) -> Result<()>
Called before the command is spawned, to mutate it as needed. Read more
Source§fn wrap_child(
&mut self,
inner: Box<dyn ChildWrapper>,
core: &CommandWrap,
) -> Result<Box<dyn ChildWrapper>>
fn wrap_child( &mut self, inner: Box<dyn ChildWrapper>, core: &CommandWrap, ) -> Result<Box<dyn ChildWrapper>>
Called to wrap a child into this command wrapper’s child wrapper. Read more
Source§fn extend(&mut self, _other: Box<dyn CommandWrapper>)
fn extend(&mut self, _other: Box<dyn CommandWrapper>)
Called on a first instance if a second of the same type is added. Read more
Source§fn post_spawn(
&mut self,
_command: &mut Command,
_child: &mut Child,
_core: &CommandWrap,
) -> Result<()>
fn post_spawn( &mut self, _command: &mut Command, _child: &mut Child, _core: &CommandWrap, ) -> Result<()>
Called after spawn, but before the child is wrapped. Read more
impl Copy for JobObject
Auto Trait Implementations§
impl Freeze for JobObject
impl RefUnwindSafe for JobObject
impl Send for JobObject
impl Sync for JobObject
impl Unpin for JobObject
impl UnwindSafe for JobObject
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