pub struct LifecycleManager { /* private fields */ }
Expand description
Server lifecycle manager
Implementations§
Source§impl LifecycleManager
impl LifecycleManager
Sourcepub async fn state(&self) -> LifecycleState
pub async fn state(&self) -> LifecycleState
Get the current lifecycle state
Sourcepub fn subscribe(&self) -> Receiver<LifecycleState>
pub fn subscribe(&self) -> Receiver<LifecycleState>
Subscribe to state changes
Sourcepub async fn transition_to(&self, new_state: LifecycleState) -> McpResult<()>
pub async fn transition_to(&self, new_state: LifecycleState) -> McpResult<()>
Transition to a new state
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if the server is in a running state
Sourcepub async fn create_shutdown_signal(&self) -> Receiver<()>
pub async fn create_shutdown_signal(&self) -> Receiver<()>
Create a shutdown signal
Sourcepub async fn trigger_shutdown(&self) -> McpResult<()>
pub async fn trigger_shutdown(&self) -> McpResult<()>
Trigger shutdown
Trait Implementations§
Source§impl Clone for LifecycleManager
impl Clone for LifecycleManager
Source§fn clone(&self) -> LifecycleManager
fn clone(&self) -> LifecycleManager
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 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