pub struct ServerLifecycle { /* private fields */ }Expand description
Server lifecycle manager
Implementations§
Source§impl ServerLifecycle
impl ServerLifecycle
Sourcepub fn new(config: MCPServerConfig, health_checker: Arc<HealthChecker>) -> Self
pub fn new(config: MCPServerConfig, health_checker: Arc<HealthChecker>) -> Self
Creates a new server lifecycle manager
Sourcepub async fn check_health(&self) -> Result<bool>
pub async fn check_health(&self) -> Result<bool>
Performs health checking and availability detection
Sourcepub async fn is_disconnected(&self) -> bool
pub async fn is_disconnected(&self) -> bool
Detects server disconnection
Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Supports configurable max retries
Sourcepub async fn get_state(&self) -> ServerState
pub async fn get_state(&self) -> ServerState
Gets the current lifecycle state
Sourcepub async fn get_info(&self) -> ServerLifecycleInfo
pub async fn get_info(&self) -> ServerLifecycleInfo
Gets the lifecycle information
Sourcepub async fn get_last_error(&self) -> Option<String>
pub async fn get_last_error(&self) -> Option<String>
Reports the last error
Sourcepub async fn get_restart_count(&self) -> u32
pub async fn get_restart_count(&self) -> u32
Gets the restart count
Sourcepub async fn get_uptime_ms(&self) -> Option<u128>
pub async fn get_uptime_ms(&self) -> Option<u128>
Gets the uptime in milliseconds
Trait Implementations§
Source§impl Clone for ServerLifecycle
impl Clone for ServerLifecycle
Source§fn clone(&self) -> ServerLifecycle
fn clone(&self) -> ServerLifecycle
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 ServerLifecycle
impl !RefUnwindSafe for ServerLifecycle
impl Send for ServerLifecycle
impl Sync for ServerLifecycle
impl Unpin for ServerLifecycle
impl !UnwindSafe for ServerLifecycle
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