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
sourceimpl 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
sourceimpl Clone for PidController
impl Clone for PidController
sourcefn clone(&self) -> PidController
fn clone(&self) -> PidController
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl Debug for PidController
impl Debug for PidController
sourceimpl<'a> From<&'a Subsystem> for &'a PidController
impl<'a> From<&'a Subsystem> for &'a PidController
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Controller for Twhere
T: ControllerInternal,
impl<T> Controller for Twhere
T: ControllerInternal,
sourcefn 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.
sourcefn 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.
sourcefn tasks(&self) -> Vec<CgroupPid, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn tasks(&self) -> Vec<CgroupPid, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Get the list of tasks that this controller has.