pub struct CpuLimit { /* private fields */ }Expand description
A handle to manage the CPU limit enforced on the target process.
Implementations§
Source§impl CpuLimit
impl CpuLimit
Sourcepub fn new(pid: Pid, limit: f64) -> Result<Self, Error>
pub fn new(pid: Pid, limit: f64) -> Result<Self, Error>
Limits the CPU time of the target process only.
Sourcepub fn new_with_children(pid: Pid, limit: f64) -> Result<Self, Error>
pub fn new_with_children(pid: Pid, limit: f64) -> Result<Self, Error>
Limits the CPU time of the target process and its children.
Sourcepub fn set_limit(&self, limit: f64) -> Result<(), Error>
pub fn set_limit(&self, limit: f64) -> Result<(), Error>
Updates the limit applied to the target process.
Sourcepub fn total_cpu_time(&self) -> Duration
pub fn total_cpu_time(&self) -> Duration
Retrieves the total amount of CPU time used by the target process.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CpuLimit
impl !RefUnwindSafe for CpuLimit
impl Send for CpuLimit
impl Sync for CpuLimit
impl Unpin for CpuLimit
impl !UnwindSafe for CpuLimit
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