pub struct ShutdownHandle { /* private fields */ }Expand description
停机句柄
用于控制 QuantumLog 的优雅停机过程
Implementations§
Source§impl ShutdownHandle
impl ShutdownHandle
Sourcepub fn create_listener(
&self,
component_name: impl Into<String>,
) -> ShutdownListener
pub fn create_listener( &self, component_name: impl Into<String>, ) -> ShutdownListener
创建停机监听器
Sourcepub async fn shutdown_graceful(&self) -> Result<ShutdownStats>
pub async fn shutdown_graceful(&self) -> Result<ShutdownStats>
发起优雅停机
Sourcepub async fn shutdown_force(&self) -> Result<ShutdownStats>
pub async fn shutdown_force(&self) -> Result<ShutdownStats>
发起强制停机
Sourcepub async fn shutdown_immediate(&self) -> Result<ShutdownStats>
pub async fn shutdown_immediate(&self) -> Result<ShutdownStats>
发起立即停机
Sourcepub fn notify_completion(&self)
pub fn notify_completion(&self)
通知停机完成
Sourcepub async fn get_state(&self) -> ShutdownState
pub async fn get_state(&self) -> ShutdownState
获取当前停机状态
Sourcepub async fn is_shutting_down(&self) -> bool
pub async fn is_shutting_down(&self) -> bool
检查是否正在停机
Sourcepub async fn is_shutdown(&self) -> bool
pub async fn is_shutdown(&self) -> bool
检查是否已停机
Sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
设置超时时间
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 UnsafeUnpin 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