Struct cgroups_rs::pid::PidController[][src]

pub struct PidController { /* fields omitted */ }

A controller that allows controlling the pids subsystem of a Cgroup.

Implementations

impl PidController[src]

pub fn new(root: PathBuf, v2: bool) -> Self[src]

Constructors a new PidController instance, with root serving as the controller’s root directory.

pub fn get_pid_events(&self) -> Result<u64>[src]

The number of times fork failed because the limit was hit.

pub fn get_pid_current(&self) -> Result<u64>[src]

The number of processes currently.

pub fn get_pid_max(&self) -> Result<MaxValue>[src]

The maximum number of processes that can exist at one time in the control group.

pub fn set_pid_max(&self, max_pid: MaxValue) -> Result<()>[src]

Set the maximum number of processes that can exist in this control group.

Note that if get_pid_current() returns a higher number than what you are about to set (max_pid), then no processess will be killed. Additonally, attaching extra processes to a control group disregards the limit.

Trait Implementations

impl Clone for PidController[src]

impl Debug for PidController[src]

impl<'a> From<&'a Subsystem> for &'a PidController[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Controller for T where
    T: ControllerInternal, 
[src]

pub fn apply(&Self, &Resources) -> Result<(), Error>[src]

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

pub fn create(&Self)[src]

Create this controller

pub fn set_notify_on_release(&Self, bool) -> Result<(), Error>[src]

Set notify_on_release

pub fn set_release_agent(&Self, &str) -> Result<(), Error>[src]

Set release_agent

pub fn exists(&Self) -> bool[src]

Does this controller already exist?

pub fn delete(&Self) -> Result<(), Error>[src]

Delete the controller.

pub fn add_task(&Self, &CgroupPid) -> Result<(), Error>[src]

Attach a task to this controller.

pub fn add_task_by_tgid(&Self, &CgroupPid) -> Result<(), Error>[src]

Attach a task to this controller by thread group id.

pub fn tasks(&Self) -> Vec<CgroupPid, Global>[src]

Get the list of tasks that this controller has.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.