Trait cgroups_rs::Controller
source · [−]pub trait Controller {
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 tasks(&self) -> Vec<CgroupPid>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,;
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
Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.
sourcefn set_notify_on_release(&self, enable: bool) -> Result<()>
fn set_notify_on_release(&self, enable: bool) -> Result<()>
Set notify_on_release
sourcefn set_release_agent(&self, path: &str) -> Result<()>
fn set_release_agent(&self, path: &str) -> Result<()>
Set release_agent
sourcefn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<()>
fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<()>
Attach a task to this controller.
Get the list of tasks that this controller has.