pub struct CratesDocsHandlerCore { /* private fields */ }Expand description
Core handler implementation (provides more control)
Implements more fine-grained MCP protocol handler interface.
Delegates all core logic to HandlerCore.
Implementations§
Source§impl CratesDocsHandlerCore
impl CratesDocsHandlerCore
Sourcepub fn new(server: Arc<CratesDocsServer>) -> Self
pub fn new(server: Arc<CratesDocsServer>) -> Self
Create a new core handler
Sourcepub fn with_config(server: Arc<CratesDocsServer>, config: HandlerConfig) -> Self
pub fn with_config(server: Arc<CratesDocsServer>, config: HandlerConfig) -> Self
Create core handler with configuration
Sourcepub fn with_merged_config(
server: Arc<CratesDocsServer>,
base_config: HandlerConfig,
override_config: Option<HandlerConfig>,
) -> Self
pub fn with_merged_config( server: Arc<CratesDocsServer>, base_config: HandlerConfig, override_config: Option<HandlerConfig>, ) -> Self
Create core handler with merged configuration
Sourcepub fn with_metrics(self, metrics: Arc<ServerMetrics>) -> Self
pub fn with_metrics(self, metrics: Arc<ServerMetrics>) -> Self
Set metrics
Sourcepub fn core(&self) -> &HandlerCore
pub fn core(&self) -> &HandlerCore
Get core handler
Sourcepub fn server(&self) -> &Arc<CratesDocsServer>
pub fn server(&self) -> &Arc<CratesDocsServer>
Get server reference
Trait Implementations§
Source§impl ServerHandlerCore for CratesDocsHandlerCore
impl ServerHandlerCore for CratesDocsHandlerCore
Source§fn handle_request<'life0, 'async_trait>(
&'life0 self,
request: RequestFromClient,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = Result<ResultFromServer, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_request<'life0, 'async_trait>(
&'life0 self,
request: RequestFromClient,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = Result<ResultFromServer, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle request
Source§fn handle_notification<'life0, 'async_trait>(
&'life0 self,
_notification: NotificationFromClient,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_notification<'life0, 'async_trait>(
&'life0 self,
_notification: NotificationFromClient,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle notification
Source§fn handle_error<'life0, 'life1, 'async_trait>(
&'life0 self,
error: &'life1 RpcError,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_error<'life0, 'life1, 'async_trait>(
&'life0 self,
error: &'life1 RpcError,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle error
Source§fn on_initialized<'life0, 'async_trait>(
&'life0 self,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_initialized<'life0, 'async_trait>(
&'life0 self,
_runtime: Arc<dyn McpServer>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Invoked when the server finishes initialization and receives an
initialized_notification from the client. Read moreAuto Trait Implementations§
impl Freeze for CratesDocsHandlerCore
impl !RefUnwindSafe for CratesDocsHandlerCore
impl Send for CratesDocsHandlerCore
impl Sync for CratesDocsHandlerCore
impl Unpin for CratesDocsHandlerCore
impl UnsafeUnpin for CratesDocsHandlerCore
impl !UnwindSafe for CratesDocsHandlerCore
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