pub trait CgroupOps:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> u64;
fn add_process(&self, thread_group: &ThreadGroup) -> Result<(), Errno>;
fn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>;
fn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>;
fn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>;
fn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>;
fn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ;
fn kill(&self);
fn is_populated(&self) -> bool;
fn freezer(&self) -> Option<&dyn FreezerOps>;
fn cpuset(&self) -> Option<&dyn CpusetOps>;
}Expand description
Common operations of all cgroups.
Required Methods§
Sourcefn add_process(&self, thread_group: &ThreadGroup) -> Result<(), Errno>
fn add_process(&self, thread_group: &ThreadGroup) -> Result<(), Errno>
Add a process to a cgroup. Errors if the cgroup has been deleted.
Sourcefn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Create a new sub-cgroup as a child of this cgroup. Errors if the cgroup is deleted, or a
child with name already exists.
Sourcefn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>
fn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>
Gets all children of this cgroup.
Sourcefn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Gets the child with name, errors if not found.
Sourcefn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Remove a child from this cgroup and return it, if found. Errors if cgroup is deleted, or a
child with name is not found.
Sourcefn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ
fn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ
Return all pids that belong to this cgroup.
Sourcefn is_populated(&self) -> bool
fn is_populated(&self) -> bool
Whether the cgroup or any of its descendants have any processes.
Sourcefn freezer(&self) -> Option<&dyn FreezerOps>
fn freezer(&self) -> Option<&dyn FreezerOps>
Returns freezer ops if freezer controller is supported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".