Skip to main content

CommandCgroupExt

Trait CommandCgroupExt 

Source
pub trait CommandCgroupExt {
    // Required method
    fn join_cgroup(&mut self, cgroup_procs: Arc<CString>) -> Result<(), Error>;
}
Available on Unix only.
Expand description

Extension trait for moving a command into a cgroup before it runs.

Required Methods§

Source

fn join_cgroup(&mut self, cgroup_procs: Arc<CString>) -> Result<(), Error>

Arranges for the command to write 0 to cgroup_procs, a cgroup v2’s cgroup.procs file, after it is forked and before it runs its program, which moves it into that cgroup.

§Errors

None here: a child that cannot open or write the file fails its spawn.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CommandCgroupExt for Command

Source§

fn join_cgroup(&mut self, cgroup_procs: Arc<CString>) -> Result<(), Error>

Implementors§