Struct cgroups_rs::pid::PidController
source · pub struct PidController { /* private fields */ }Expand description
A controller that allows controlling the pids subsystem of a Cgroup.
Implementations§
source§impl PidController
impl PidController
sourcepub fn new(root: PathBuf, v2: bool) -> Self
pub fn new(root: PathBuf, v2: bool) -> Self
Constructors a new PidController instance, with root serving as the controller’s root
directory.
sourcepub fn get_pid_events(&self) -> Result<u64>
pub fn get_pid_events(&self) -> Result<u64>
The number of times fork failed because the limit was hit.
sourcepub fn get_pid_current(&self) -> Result<u64>
pub fn get_pid_current(&self) -> Result<u64>
The number of processes currently.
sourcepub fn get_pid_max(&self) -> Result<MaxValue>
pub fn get_pid_max(&self) -> Result<MaxValue>
The maximum number of processes that can exist at one time in the control group.
sourcepub fn set_pid_max(&self, max_pid: MaxValue) -> Result<()>
pub fn set_pid_max(&self, max_pid: MaxValue) -> Result<()>
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§
source§impl Clone for PidController
impl Clone for PidController
source§fn clone(&self) -> PidController
fn clone(&self) -> PidController
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for PidController
impl Debug for PidController
source§impl<'a> From<&'a Subsystem> for &'a PidController
impl<'a> From<&'a Subsystem> for &'a PidController
source§fn from(sub: &'a Subsystem) -> &'a PidController
fn from(sub: &'a Subsystem) -> &'a PidController
Auto Trait Implementations§
impl RefUnwindSafe for PidController
impl Send for PidController
impl Sync for PidController
impl Unpin for PidController
impl UnwindSafe for PidController
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Controller for Twhere
T: ControllerInternal,
impl<T> Controller for Twhere T: ControllerInternal,
source§fn apply(&self, res: &Resources) -> Result<(), Error>
fn apply(&self, res: &Resources) -> Result<(), Error>
Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.
source§fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<(), Error>
fn add_task_by_tgid(&self, pid: &CgroupPid) -> Result<(), Error>
Attach a task to this controller by thread group id.