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(oroot: PathBuf) -> Self
pub fn new(oroot: PathBuf) -> Self
Constructors a new PidController
instance, with oroot
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<PidMax>
pub fn get_pid_max(&self) -> Result<PidMax>
The maximum number of processes that can exist at one time in the control group.
Sourcepub fn set_pid_max(&self, max_pid: PidMax) -> Result<()>
pub fn set_pid_max(&self, max_pid: PidMax) -> 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more