Trait Controller

Source
pub trait Controller {
Show 14 methods // Required methods fn path(&self) -> &Path; fn apply(&self, res: &Resources) -> Result<()>; fn create(&self); fn exists(&self) -> bool; fn set_notify_on_release(&self, enable: bool) -> Result<()>; fn set_release_agent(&self, path: &str) -> Result<()>; fn delete(&self) -> Result<()>; fn add_task(&self, pid: &CgroupPid) -> Result<()>; fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<()>; fn set_cgroup_type(&self, cgroup_type: &str) -> Result<()>; fn get_cgroup_type(&self) -> Result<String>; fn tasks(&self) -> Vec<CgroupPid>; fn procs(&self) -> Vec<CgroupPid>; fn v2(&self) -> bool;
}
Expand description

A Controller is a subsystem attached to the control group.

Implementors are able to control certain aspects of a control group.

Required Methods§

Source

fn path(&self) -> &Path

The file system path to the controller.

Source

fn apply(&self, res: &Resources) -> Result<()>

Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.

Source

fn create(&self)

Create this controller

Source

fn exists(&self) -> bool

Does this controller already exist?

Source

fn set_notify_on_release(&self, enable: bool) -> Result<()>

Set notify_on_release

Source

fn set_release_agent(&self, path: &str) -> Result<()>

Set release_agent

Source

fn delete(&self) -> Result<()>

Delete the controller.

Source

fn add_task(&self, pid: &CgroupPid) -> Result<()>

Attach a task to this controller.

Source

fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<()>

Attach a task to this controller.

Source

fn set_cgroup_type(&self, cgroup_type: &str) -> Result<()>

set cgroup type.

Source

fn get_cgroup_type(&self) -> Result<String>

get cgroup type.

Source

fn tasks(&self) -> Vec<CgroupPid>

Get the list of tasks that this controller has.

Source

fn procs(&self) -> Vec<CgroupPid>

Get the list of procs that this controller has.

Source

fn v2(&self) -> bool

Implementors§

Source§

impl<T> Controller for T
where T: ControllerInternal,