pub struct McpServer<B: McpBackend> { /* private fields */ }
Expand description
Generic MCP server with pluggable backend
Implementations§
Source§impl<B: McpBackend + 'static> McpServer<B>
impl<B: McpBackend + 'static> McpServer<B>
Sourcepub async fn new(backend: B, config: ServerConfig) -> Result<Self, ServerError>
pub async fn new(backend: B, config: ServerConfig) -> Result<Self, ServerError>
Create a new MCP server with the given backend and configuration
Sourcepub async fn start(&mut self) -> Result<(), ServerError>
pub async fn start(&mut self) -> Result<(), ServerError>
Start the server
Sourcepub async fn stop(&mut self) -> Result<(), ServerError>
pub async fn stop(&mut self) -> Result<(), ServerError>
Stop the server gracefully
Sourcepub async fn run(&mut self) -> Result<(), ServerError>
pub async fn run(&mut self) -> Result<(), ServerError>
Run the server until shutdown signal
Sourcepub async fn health_check(&self) -> Result<HealthStatus, ServerError>
pub async fn health_check(&self) -> Result<HealthStatus, ServerError>
Get server health status
Sourcepub async fn get_metrics(&self) -> ServerMetrics
pub async fn get_metrics(&self) -> ServerMetrics
Get server metrics
Sourcepub fn get_server_info(&self) -> &ServerInfo
pub fn get_server_info(&self) -> &ServerInfo
Get server information
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if server is running
Sourcepub fn get_alert_manager(&self) -> Arc<AlertManager>
pub fn get_alert_manager(&self) -> Arc<AlertManager>
Get alert manager
Sourcepub fn get_dashboard_manager(&self) -> Arc<DashboardManager>
pub fn get_dashboard_manager(&self) -> Arc<DashboardManager>
Get dashboard manager
Sourcepub fn get_profiler(&self) -> Option<Arc<PerformanceProfiler>>
pub fn get_profiler(&self) -> Option<Arc<PerformanceProfiler>>
Get profiler
Auto Trait Implementations§
impl<B> Freeze for McpServer<B>
impl<B> !RefUnwindSafe for McpServer<B>
impl<B> Send for McpServer<B>
impl<B> Sync for McpServer<B>
impl<B> Unpin for McpServer<B>
impl<B> !UnwindSafe for McpServer<B>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more