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 Freeze for PidController
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.