pub struct ShutdownHandle { /* private fields */ }
Expand description
Handle for triggering graceful server shutdown
Provides external control over server shutdown with support for:
- Signal handling: SIGTERM, SIGINT, custom signals
- Container orchestration: Kubernetes graceful termination
- Health checks: Coordinated shutdown with load balancers
- Multi-service coordination: Synchronized shutdown sequences
- Testing: Controlled server lifecycle in tests
The handle is cloneable and thread-safe, allowing multiple components to coordinate shutdown or check shutdown status.
Implementations§
Source§impl ShutdownHandle
impl ShutdownHandle
Sourcepub async fn is_shutting_down(&self) -> bool
pub async fn is_shutting_down(&self) -> bool
Check if shutdown has been initiated
Trait Implementations§
Source§impl Clone for ShutdownHandle
impl Clone for ShutdownHandle
Source§fn clone(&self) -> ShutdownHandle
fn clone(&self) -> ShutdownHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ShutdownHandle
impl !RefUnwindSafe for ShutdownHandle
impl Send for ShutdownHandle
impl Sync for ShutdownHandle
impl Unpin for ShutdownHandle
impl !UnwindSafe for ShutdownHandle
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