pub struct Escalation { /* private fields */ }Expand description
How a run stops its child: each step sends a signal to the group and waits its grace for the child to exit, and a kill follows the last step.
The default escalation has no steps, so a stop kills at once. Each caller states its own steps, because a graceful signal helps only a child that handles it:
use std::time::Duration;
use crumbkit_process::{Escalation, Signal};
let polite = Escalation::default()
.step(Signal::Interrupt, Duration::from_secs(2))
.step(Signal::Terminate, Duration::from_secs(5));
assert_ne!(polite, Escalation::default());On Windows a stop skips the steps and ends the job at once (ADR-0171).
Implementations§
Source§impl Escalation
impl Escalation
Sourcepub fn step(self, signal: Signal, grace: Duration) -> Self
pub fn step(self, signal: Signal, grace: Duration) -> Self
Returns this escalation with one more step, which sends signal and
waits at most grace for the child to exit.
A step after a Signal::Kill step runs only when the child has not
exited within the kill’s grace.
Trait Implementations§
Source§impl Clone for Escalation
impl Clone for Escalation
Source§impl Debug for Escalation
impl Debug for Escalation
Source§impl Default for Escalation
impl Default for Escalation
impl Eq for Escalation
Source§impl PartialEq for Escalation
impl PartialEq for Escalation
impl StructuralPartialEq for Escalation
Auto Trait Implementations§
impl Forget for Escalation
impl Freeze for Escalation
impl RefUnwindSafe for Escalation
impl Send for Escalation
impl Sync for Escalation
impl Unpin for Escalation
impl UnsafeUnpin for Escalation
impl UnwindSafe for Escalation
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