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§
Sourcefn register_server(&self, name: &str, config: McpServerConfig)
fn register_server(&self, name: &str, config: McpServerConfig)
Register a server configuration
Sourcefn 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 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
Sourcefn set_dependencies(&self, name: &str, dependencies: Vec<String>)
fn set_dependencies(&self, name: &str, dependencies: Vec<String>)
Set server dependencies
Sourcefn 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<'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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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<'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
Sourcefn 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 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
Sourcefn 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<'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
Sourcefn restart_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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,
Restart all servers
Sourcefn 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<'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
Sourcefn 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 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
Sourcefn get_state(&self, server_name: &str) -> ServerState
fn get_state(&self, server_name: &str) -> ServerState
Get server state
Sourcefn get_process(&self, server_name: &str) -> Option<ServerProcess>
fn get_process(&self, server_name: &str) -> Option<ServerProcess>
Get server process info
Sourcefn get_all_processes(&self) -> Vec<ServerProcess>
fn get_all_processes(&self) -> Vec<ServerProcess>
Get all server processes
Sourcefn is_running(&self, server_name: &str) -> bool
fn is_running(&self, server_name: &str) -> bool
Check if a server is running
Sourcefn get_running_servers(&self) -> Vec<String>
fn get_running_servers(&self) -> Vec<String>
Get list of running servers
Sourcefn subscribe(&self) -> Receiver<LifecycleEvent>
fn subscribe(&self) -> Receiver<LifecycleEvent>
Subscribe to lifecycle events