#[non_exhaustive]pub enum Mechanism {
JobObject,
CgroupV2,
ProcessGroup,
}Expand description
The containment mechanism actually in effect for a process group.
Surfaced so callers can tell how the no-orphan guarantee is enforced — in
particular when the mechanism is a POSIX process group rather than a cgroup or
Job Object (the primary mechanism on macOS/BSD, and the Linux fallback when no
cgroup is writable), which weakens the guarantee against children that call
setsid.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
JobObject
Windows Job Object with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.
CgroupV2
Linux cgroup v2, torn down via cgroup.kill.
ProcessGroup
POSIX process group, torn down via killpg. The primary mechanism on
macOS and the BSDs, and the Linux fallback when no cgroup is writable.
Weaker than a cgroup/Job Object: a child that calls setsid escapes it.
Trait Implementations§
impl Copy for Mechanism
impl Eq for Mechanism
impl StructuralPartialEq for Mechanism
Auto Trait Implementations§
impl Freeze for Mechanism
impl RefUnwindSafe for Mechanism
impl Send for Mechanism
impl Sync for Mechanism
impl Unpin for Mechanism
impl UnsafeUnpin for Mechanism
impl UnwindSafe for Mechanism
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