pub trait LifecycleListener: Send + Sync {
// Required method
fn on_state_change(
&self,
old_state: LifecycleState,
new_state: LifecycleState,
);
// Provided methods
fn on_start(&self) { ... }
fn on_stop(&self) { ... }
fn on_error(&self, _error: &McpError) { ... }
}
Expand description
Lifecycle event listener
Required Methods§
Sourcefn on_state_change(&self, old_state: LifecycleState, new_state: LifecycleState)
fn on_state_change(&self, old_state: LifecycleState, new_state: LifecycleState)
Called when the server state changes