pub struct ShutdownConfig {
pub timeout: Duration,
pub service_timeout: Duration,
pub force_kill: bool,
}Expand description
Configuration for shutdown behavior
Fields§
§timeout: DurationTotal shutdown timeout
service_timeout: DurationPer-service timeout
force_kill: boolWhether to force kill after timeout
Implementations§
Source§impl ShutdownConfig
impl ShutdownConfig
Sourcepub fn new(timeout_secs: u64) -> Self
pub fn new(timeout_secs: u64) -> Self
Create a new shutdown configuration
§Arguments
timeout_secs- Total timeout in seconds
Service timeout is automatically set to half of the total timeout.
Sourcepub fn with_timeouts(total_timeout_secs: u64, service_timeout_secs: u64) -> Self
pub fn with_timeouts(total_timeout_secs: u64, service_timeout_secs: u64) -> Self
Create a new shutdown configuration with explicit timeouts
Sourcepub fn force_kill(self, force: bool) -> Self
pub fn force_kill(self, force: bool) -> Self
Set whether to force kill after timeout
Trait Implementations§
Source§impl Clone for ShutdownConfig
impl Clone for ShutdownConfig
Source§fn clone(&self) -> ShutdownConfig
fn clone(&self) -> ShutdownConfig
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 moreSource§impl Debug for ShutdownConfig
impl Debug for ShutdownConfig
Auto Trait Implementations§
impl Freeze for ShutdownConfig
impl RefUnwindSafe for ShutdownConfig
impl Send for ShutdownConfig
impl Sync for ShutdownConfig
impl Unpin for ShutdownConfig
impl UnsafeUnpin for ShutdownConfig
impl UnwindSafe for ShutdownConfig
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