pub struct ServerLifecycleManager { /* private fields */ }
Expand description
Server lifecycle manager
Manages the lifecycle events and status for MCP servers.
All public methods are instrumented with tracing
spans.
Implementations§
Source§impl ServerLifecycleManager
impl ServerLifecycleManager
Sourcepub fn record_event(
&self,
id: ServerId,
name: String,
event: ServerLifecycleEvent,
details: Option<String>,
) -> Result<()>
pub fn record_event( &self, id: ServerId, name: String, event: ServerLifecycleEvent, details: Option<String>, ) -> Result<()>
Record a server event
Records a lifecycle event for a server and updates its status accordingly.
This method is instrumented with tracing
.
§Arguments
id
- The ID of the servername
- The name of the serverevent
- The lifecycle event typedetails
- Optional details about the event
§Returns
A Result
indicating success or failure
Sourcepub fn get_status(&self, id: ServerId) -> Result<ServerStatus>
pub fn get_status(&self, id: ServerId) -> Result<ServerStatus>
Sourcepub fn get_server_events(
&self,
id: ServerId,
limit: Option<usize>,
) -> Result<Vec<ServerEvent>>
pub fn get_server_events( &self, id: ServerId, limit: Option<usize>, ) -> Result<Vec<ServerEvent>>
Get recent events for a server
Retrieves a list of recent events for a specific server, sorted by timestamp with newest events first.
§Arguments
id
- The ID of the serverlimit
- Optional maximum number of events to return
§Returns
A Result<Vec<ServerEvent>>
containing the server events if successful
Sourcepub fn get_all_events(&self, limit: Option<usize>) -> Result<Vec<ServerEvent>>
pub fn get_all_events(&self, limit: Option<usize>) -> Result<Vec<ServerEvent>>
Sourcepub fn clear_events(&self) -> Result<()>
pub fn clear_events(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServerLifecycleManager
impl RefUnwindSafe for ServerLifecycleManager
impl Send for ServerLifecycleManager
impl Sync for ServerLifecycleManager
impl Unpin for ServerLifecycleManager
impl UnwindSafe for ServerLifecycleManager
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