pub struct LifecycleManager { /* private fields */ }Expand description
Manager for session lifecycle events.
Implementations§
Source§impl LifecycleManager
impl LifecycleManager
Sourcepub fn set_shutdown_config(&mut self, config: ShutdownConfig)
pub fn set_shutdown_config(&mut self, config: ShutdownConfig)
Set the shutdown configuration.
Sourcepub const fn shutdown_config(&self) -> &ShutdownConfig
pub const fn shutdown_config(&self) -> &ShutdownConfig
Get the shutdown configuration.
Sourcepub fn on_event(&mut self, callback: LifecycleCallback)
pub fn on_event(&mut self, callback: LifecycleCallback)
Register a lifecycle callback.
Sourcepub fn emit(&self, event: &LifecycleEvent)
pub fn emit(&self, event: &LifecycleEvent)
Emit a lifecycle event.
Sourcepub fn set_state(&mut self, state: SessionState)
pub fn set_state(&mut self, state: SessionState)
Update the session state and emit event.
Sourcepub const fn state(&self) -> &SessionState
pub const fn state(&self) -> &SessionState
Get the current state.
Sourcepub fn shutting_down(&mut self)
pub fn shutting_down(&mut self)
Signal that the session is shutting down.
Sourcepub fn exited(&mut self, status: ProcessExitStatus)
pub fn exited(&mut self, status: ProcessExitStatus)
Signal that the session has exited.
Trait Implementations§
Source§impl Debug for LifecycleManager
impl Debug for LifecycleManager
Auto Trait Implementations§
impl Freeze for LifecycleManager
impl !RefUnwindSafe for LifecycleManager
impl Send for LifecycleManager
impl Sync for LifecycleManager
impl Unpin for LifecycleManager
impl !UnwindSafe for LifecycleManager
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