Skip to main content

LifecycleManager

Trait LifecycleManager 

Source
pub trait LifecycleManager: Send + Sync {
Show 19 methods // Required methods fn register_server(&self, name: &str, config: McpServerConfig); fn unregister_server<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set_dependencies(&self, name: &str, dependencies: Vec<String>); fn start<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, options: Option<StartOptions>, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn start_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn start_with_dependencies<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn stop<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, options: Option<StopOptions>, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn stop_all<'life0, 'async_trait>( &'life0 self, force: bool, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn restart<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn restart_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn health_check<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = HealthCheckResult> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn health_check_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = HashMap<String, HealthCheckResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_state(&self, server_name: &str) -> ServerState; fn get_process(&self, server_name: &str) -> Option<ServerProcess>; fn get_all_processes(&self) -> Vec<ServerProcess>; fn is_running(&self, server_name: &str) -> bool; fn get_running_servers(&self) -> Vec<String>; fn subscribe(&self) -> Receiver<LifecycleEvent>; fn cleanup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Lifecycle manager trait

Defines the interface for managing MCP server lifecycles.

Required Methods§

Source

fn register_server(&self, name: &str, config: McpServerConfig)

Register a server configuration

Source

fn unregister_server<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unregister a server

Source

fn set_dependencies(&self, name: &str, dependencies: Vec<String>)

Set server dependencies

Source

fn start<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, options: Option<StartOptions>, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Start a server

Source

fn start_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start all registered servers

Source

fn start_with_dependencies<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Start a server with its dependencies

Source

fn stop<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, options: Option<StopOptions>, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stop a server

Source

fn stop_all<'life0, 'async_trait>( &'life0 self, force: bool, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop all servers

Source

fn restart<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Restart a server

Source

fn restart_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Restart all servers

Source

fn health_check<'life0, 'life1, 'async_trait>( &'life0 self, server_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = HealthCheckResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Perform health check on a server

Source

fn health_check_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = HashMap<String, HealthCheckResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform health check on all servers

Source

fn get_state(&self, server_name: &str) -> ServerState

Get server state

Source

fn get_process(&self, server_name: &str) -> Option<ServerProcess>

Get server process info

Source

fn get_all_processes(&self) -> Vec<ServerProcess>

Get all server processes

Source

fn is_running(&self, server_name: &str) -> bool

Check if a server is running

Source

fn get_running_servers(&self) -> Vec<String>

Get list of running servers

Source

fn subscribe(&self) -> Receiver<LifecycleEvent>

Subscribe to lifecycle events

Source

fn cleanup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cleanup all resources

Implementors§