#[non_exhaustive]pub struct SignalPolicy {
pub grace_period: Duration,
pub create_process_group: bool,
pub terminate_descendants: bool,
}Expand description
Signal and process-tree termination policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.grace_period: DurationGrace period to wait after graceful termination before killing.
create_process_group: boolCreate a new process group/session where supported.
terminate_descendants: boolTerminate the process group rather than only the immediate child where supported.
Implementations§
Source§impl SignalPolicy
impl SignalPolicy
Sourcepub fn with_grace_period(self, grace_period: Duration) -> Self
pub fn with_grace_period(self, grace_period: Duration) -> Self
Set the graceful termination period before kill escalation.
Sourcepub fn with_create_process_group(self, create_process_group: bool) -> Self
pub fn with_create_process_group(self, create_process_group: bool) -> Self
Set whether processes are spawned into a new process group where supported.
Sourcepub fn with_terminate_descendants(self, terminate_descendants: bool) -> Self
pub fn with_terminate_descendants(self, terminate_descendants: bool) -> Self
Set whether termination targets descendants through the process group.
Trait Implementations§
Source§impl Clone for SignalPolicy
impl Clone for SignalPolicy
Source§fn clone(&self) -> SignalPolicy
fn clone(&self) -> SignalPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SignalPolicy
Source§impl Debug for SignalPolicy
impl Debug for SignalPolicy
Source§impl Default for SignalPolicy
impl Default for SignalPolicy
impl Eq for SignalPolicy
Source§impl PartialEq for SignalPolicy
impl PartialEq for SignalPolicy
impl StructuralPartialEq for SignalPolicy
Auto Trait Implementations§
impl Freeze for SignalPolicy
impl RefUnwindSafe for SignalPolicy
impl Send for SignalPolicy
impl Sync for SignalPolicy
impl Unpin for SignalPolicy
impl UnsafeUnpin for SignalPolicy
impl UnwindSafe for SignalPolicy
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