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§
Sourcefn add_task(&self, pid: Pid) -> Result<(), Self::Error>
fn add_task(&self, pid: Pid) -> Result<(), Self::Error>
Adds a task specified by its pid to the cgroup
Sourcefn apply(&self, controller_opt: &ControllerOpt<'_>) -> Result<(), Self::Error>
fn apply(&self, controller_opt: &ControllerOpt<'_>) -> Result<(), Self::Error>
Applies resource restrictions to the cgroup
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".