Skip to main content

CgroupManager

Trait CgroupManager 

Source
pub trait CgroupManager {
    type Error;

    // Required methods
    fn add_task(&self, pid: Pid) -> Result<(), Self::Error>;
    fn apply(
        &self,
        controller_opt: &ControllerOpt<'_>,
    ) -> Result<(), Self::Error>;
    fn remove(&self) -> Result<(), Self::Error>;
    fn freeze(&self, state: FreezerState) -> Result<(), Self::Error>;
    fn stats(&self) -> Result<Stats, Self::Error>;
    fn get_all_pids(&self) -> Result<Vec<Pid>, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn add_task(&self, pid: Pid) -> Result<(), Self::Error>

Adds a task specified by its pid to the cgroup

Source

fn apply(&self, controller_opt: &ControllerOpt<'_>) -> Result<(), Self::Error>

Applies resource restrictions to the cgroup

Source

fn remove(&self) -> Result<(), Self::Error>

Removes the cgroup

Source

fn freeze(&self, state: FreezerState) -> Result<(), Self::Error>

Sets the freezer cgroup to the specified state

Source

fn stats(&self) -> Result<Stats, Self::Error>

Retrieve statistics for the cgroup

Source

fn get_all_pids(&self) -> Result<Vec<Pid>, Self::Error>

Gets the PIDs inside the cgroup

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§