pub struct Watchdog { /* private fields */ }Implementations§
Source§impl Watchdog
impl Watchdog
Sourcepub fn new(timeout_secs: u64) -> Self
pub fn new(timeout_secs: u64) -> Self
Create a wall-clock-only watchdog. timeout_secs = 0 disables it.
Equivalent to [Watchdog::with_limits(timeout_secs, 0)].
Sourcepub fn with_limits(timeout_secs: u64, max_rss_kb: u64) -> Self
pub fn with_limits(timeout_secs: u64, max_rss_kb: u64) -> Self
Create a watchdog guarding a wall-clock deadline and a resident-memory
ceiling. timeout_secs = 0 disables the time guard; max_rss_kb = 0
disables the memory guard. With both 0 this is a no-op handle.
The thread polls cancelled, the deadline, and RSS every poll_interval.
On a time breach it exits EXIT_TIMEOUT; on a memory breach,
EXIT_OOM. The memory guard is inactive where process_rss_kb
returns None (non-Linux); see the module portability note.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Watchdog
impl RefUnwindSafe for Watchdog
impl Send for Watchdog
impl Sync for Watchdog
impl Unpin for Watchdog
impl UnsafeUnpin for Watchdog
impl UnwindSafe for Watchdog
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