pub struct Server(/* private fields */);Expand description
Cloneable, type-erased MCP server.
Wraps any backend adapter behind an Arc using rmcp’s DynService
for type erasure. All database backends produce the same concrete
type, eliminating the need for enum dispatch.
Implementations§
Source§impl Server
impl Server
Sourcepub fn new(server: impl ServiceExt<RoleServer>) -> Self
pub fn new(server: impl ServiceExt<RoleServer>) -> Self
Creates a new server from any backend adapter.
Trait Implementations§
Source§impl Service<RoleServer> for Server
impl Service<RoleServer> for Server
fn handle_request( &self, request: <RoleServer as ServiceRole>::PeerReq, context: RequestContext<RoleServer>, ) -> impl Future<Output = Result<<RoleServer as ServiceRole>::Resp, ErrorData>> + Send + '_
fn handle_notification( &self, notification: <RoleServer as ServiceRole>::PeerNot, context: NotificationContext<RoleServer>, ) -> impl Future<Output = Result<(), ErrorData>> + Send + '_
fn get_info(&self) -> <RoleServer as ServiceRole>::Info
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl !UnwindSafe for Server
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> 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§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<S> ServiceExt<RoleServer> for Swhere
S: Service<RoleServer>,
impl<S> ServiceExt<RoleServer> for Swhere
S: Service<RoleServer>,
fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<RoleServer, S>, ServerInitializeError>> + MaybeSendFuture
Source§fn into_dyn(self) -> Box<dyn DynService<R>>
fn into_dyn(self) -> Box<dyn DynService<R>>
Convert this service to a dynamic boxed service Read more