pub struct SerialHandler { /* private fields */ }Implementations§
Source§impl SerialHandler
impl SerialHandler
Sourcepub fn builder() -> SerialHandlerBuilder
pub fn builder() -> SerialHandlerBuilder
Entry point for the builder.
Sourcepub fn new() -> Self
pub fn new() -> Self
Default handler: default connections, empty allowlist, default budget, profiles loaded from the default path, reconnect supervisor spawned.
Falls back to an ephemeral (non-persistent) store with a warning when
the default path cannot be resolved or contains invalid data — for
library/test convenience. Production main.rs does not use this
fallback: it resolves --profiles-path and fails startup on invalid
persistent data.
Sourcepub fn spawn_reconnect_supervisor(&self)
pub fn spawn_reconnect_supervisor(&self)
Start the background reconnect supervisor task. Requires a Tokio runtime to be active (panics otherwise).
Sourcepub fn list_ports_tool_attr() -> Tool
pub fn list_ports_tool_attr() -> Tool
Generated tool metadata function for list_ports
Sourcepub fn list_connections_tool_attr() -> Tool
pub fn list_connections_tool_attr() -> Tool
Generated tool metadata function for list_connections
Sourcepub fn open_tool_attr() -> Tool
pub fn open_tool_attr() -> Tool
Generated tool metadata function for open
Sourcepub fn close_tool_attr() -> Tool
pub fn close_tool_attr() -> Tool
Generated tool metadata function for close
Sourcepub fn write_tool_attr() -> Tool
pub fn write_tool_attr() -> Tool
Generated tool metadata function for write
Sourcepub fn transact_tool_attr() -> Tool
pub fn transact_tool_attr() -> Tool
Generated tool metadata function for transact
Sourcepub fn read_tool_attr() -> Tool
pub fn read_tool_attr() -> Tool
Generated tool metadata function for read
Sourcepub fn flush_tool_attr() -> Tool
pub fn flush_tool_attr() -> Tool
Generated tool metadata function for flush
Sourcepub fn set_dtr_rts_tool_attr() -> Tool
pub fn set_dtr_rts_tool_attr() -> Tool
Generated tool metadata function for set_dtr_rts
Sourcepub fn set_flow_control_tool_attr() -> Tool
pub fn set_flow_control_tool_attr() -> Tool
Generated tool metadata function for set_flow_control
Sourcepub fn send_break_tool_attr() -> Tool
pub fn send_break_tool_attr() -> Tool
Generated tool metadata function for send_break
Sourcepub fn get_status_tool_attr() -> Tool
pub fn get_status_tool_attr() -> Tool
Generated tool metadata function for get_status
Sourcepub fn reconfigure_tool_attr() -> Tool
pub fn reconfigure_tool_attr() -> Tool
Generated tool metadata function for reconfigure
Sourcepub fn list_profiles_tool_attr() -> Tool
pub fn list_profiles_tool_attr() -> Tool
Generated tool metadata function for list_profiles
Sourcepub fn open_profile_tool_attr() -> Tool
pub fn open_profile_tool_attr() -> Tool
Generated tool metadata function for open_profile
Sourcepub fn save_profile_tool_attr() -> Tool
pub fn save_profile_tool_attr() -> Tool
Generated tool metadata function for save_profile
Sourcepub fn delete_profile_tool_attr() -> Tool
pub fn delete_profile_tool_attr() -> Tool
Generated tool metadata function for delete_profile
Sourcepub fn rollback_profile_tool_attr() -> Tool
pub fn rollback_profile_tool_attr() -> Tool
Generated tool metadata function for rollback_profile
Sourcepub fn configure_tool_attr() -> Tool
pub fn configure_tool_attr() -> Tool
Generated tool metadata function for configure
Sourcepub fn get_log_tool_attr() -> Tool
pub fn get_log_tool_attr() -> Tool
Generated tool metadata function for get_log
Sourcepub fn clear_log_tool_attr() -> Tool
pub fn clear_log_tool_attr() -> Tool
Generated tool metadata function for clear_log
Sourcepub fn export_log_tool_attr() -> Tool
pub fn export_log_tool_attr() -> Tool
Generated tool metadata function for export_log
Sourcepub fn reconnect_tool_attr() -> Tool
pub fn reconnect_tool_attr() -> Tool
Generated tool metadata function for reconnect
Sourcepub fn capture_boot_tool_attr() -> Tool
pub fn capture_boot_tool_attr() -> Tool
Generated tool metadata function for capture_boot
Sourcepub fn compute_checksum_tool_attr() -> Tool
pub fn compute_checksum_tool_attr() -> Tool
Generated tool metadata function for compute_checksum
Source§impl SerialHandler
impl SerialHandler
pub fn diagnose_port_prompt_prompt_attr() -> Prompt
pub fn interactive_terminal_prompt_prompt_attr() -> Prompt
Trait Implementations§
Source§impl Clone for SerialHandler
impl Clone for SerialHandler
Source§impl Default for SerialHandler
impl Default for SerialHandler
Source§impl ServerHandler for SerialHandler
impl ServerHandler for SerialHandler
Source§async fn get_prompt(
&self,
request: GetPromptRequestParams,
context: RequestContext<RoleServer>,
) -> Result<GetPromptResponse, McpError>
async fn get_prompt( &self, request: GetPromptRequestParams, context: RequestContext<RoleServer>, ) -> Result<GetPromptResponse, McpError>
Route prompts/get through the same prompt_router the
#[prompt_handler] macro would use (hand-written because that macro
replaces the method unconditionally — see the impl attribute note).
fn get_info(&self) -> ServerInfo
async fn initialize( &self, request: InitializeRequestParams, context: RequestContext<RoleServer>, ) -> Result<InitializeResult, McpError>
Source§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
Source§async fn discover(
&self,
_context: RequestContext<RoleServer>,
) -> Result<DiscoverResult, McpError>
async fn discover( &self, _context: RequestContext<RoleServer>, ) -> Result<DiscoverResult, McpError>
Source§fn accepted_subscription_filter(
&self,
requested: &SubscriptionFilter,
) -> Option<SubscriptionFilter>
fn accepted_subscription_filter( &self, requested: &SubscriptionFilter, ) -> Option<SubscriptionFilter>
Source§async fn listen(&self, context: SubscriptionContext) -> Result<(), McpError>
async fn listen(&self, context: SubscriptionContext) -> Result<(), McpError>
async fn list_resources( &self, request: Option<PaginatedRequestParams>, ctx: RequestContext<RoleServer>, ) -> Result<ListResourcesResult, McpError>
async fn list_resource_templates( &self, request: Option<PaginatedRequestParams>, ctx: RequestContext<RoleServer>, ) -> Result<ListResourceTemplatesResult, McpError>
async fn read_resource( &self, request: ReadResourceRequestParams, ctx: RequestContext<RoleServer>, ) -> Result<ReadResourceResponse, McpError>
async fn complete( &self, request: CompleteRequestParams, _ctx: RequestContext<RoleServer>, ) -> Result<CompleteResult, McpError>
async fn list_tools( &self, request: Option<PaginatedRequestParams>, ctx: RequestContext<RoleServer>, ) -> Result<ListToolsResult, McpError>
async fn list_prompts( &self, request: Option<PaginatedRequestParams>, ctx: RequestContext<RoleServer>, ) -> Result<ListPromptsResult, McpError>
Source§async fn call_tool(
&self,
request: CallToolRequestParams,
context: RequestContext<RoleServer>,
) -> Result<CallToolResponse, ErrorData>
async fn call_tool( &self, request: CallToolRequestParams, context: RequestContext<RoleServer>, ) -> Result<CallToolResponse, ErrorData>
tools/call request from a client. Read morefn ping( &self, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn set_level( &self, request: SetLevelRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
Source§fn subscribe(
&self,
request: SubscribeRequestParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn subscribe( &self, request: SubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
resources/subscribe is legacy-only; implement accepted_subscription_filter and listen for protocol version 2026-07-28
Source§fn unsubscribe(
&self,
request: UnsubscribeRequestParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn unsubscribe( &self, request: UnsubscribeRequestParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
resources/unsubscribe is legacy-only; subscriptions/listen is cancelled through its request lifecycle
fn on_custom_request( &self, request: CustomRequest, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<CustomResult, ErrorData>> + MaybeSendFuture
fn on_cancelled( &self, notification: CancelledNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_progress( &self, notification: ProgressNotificationParam, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_initialized( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_roots_list_changed( &self, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_custom_notification( &self, notification: CustomNotification, context: NotificationContext<RoleServer>, ) -> impl Future<Output = ()> + MaybeSendFuture
Source§fn get_task(
&self,
request: GetTaskParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<GetTaskResult, ErrorData>> + MaybeSendFuture
fn get_task( &self, request: GetTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<GetTaskResult, ErrorData>> + MaybeSendFuture
tasks/get: return the current DetailedTask state.Source§fn update_task(
&self,
request: UpdateTaskParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn update_task( &self, request: UpdateTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
tasks/update: accept responses to outstanding in-task
input requests. Returns an empty acknowledgement on success.Source§fn cancel_task(
&self,
request: CancelTaskParams,
context: RequestContext<RoleServer>,
) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn cancel_task( &self, request: CancelTaskParams, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
tasks/cancel: cooperative cancellation. Returns an empty
acknowledgement; the task’s observable status may lag.Auto Trait Implementations§
impl !RefUnwindSafe for SerialHandler
impl !UnwindSafe for SerialHandler
impl Freeze for SerialHandler
impl Send for SerialHandler
impl Sync for SerialHandler
impl Unpin for SerialHandler
impl UnsafeUnpin for SerialHandler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
impl<R, S> DynService<R> for Swhere
R: ServiceRole,
S: Service<R>,
fn handle_request( &self, request: <R as ServiceRole>::PeerReq, context: RequestContext<R>, ) -> Pin<Box<dyn Future<Output = Result<<R as ServiceRole>::Resp, ErrorData>> + Send + '_>>
fn handle_notification( &self, notification: <R as ServiceRole>::PeerNot, context: NotificationContext<R>, ) -> Pin<Box<dyn Future<Output = Result<(), ErrorData>> + Send + '_>>
fn get_info(&self) -> <R as ServiceRole>::Info
Source§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
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<H> Service<RoleServer> for Hwhere
H: ServerHandler,
impl<H> Service<RoleServer> for Hwhere
H: ServerHandler,
async fn handle_request( &self, request: <RoleServer as ServiceRole>::PeerReq, context: RequestContext<RoleServer>, ) -> Result<<RoleServer as ServiceRole>::Resp, ErrorData>
async fn handle_notification( &self, notification: <RoleServer as ServiceRole>::PeerNot, context: NotificationContext<RoleServer>, ) -> Result<(), ErrorData>
fn get_info(&self) -> <RoleServer as ServiceRole>::Info
Source§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
initialize
negotiation may agree to. Read more