pub struct BackendNotificationBridge { /* private fields */ }Expand description
Client-side handler used when the proxy connects to a backend MCP server.
Implementations§
Source§impl BackendNotificationBridge
impl BackendNotificationBridge
Sourcepub fn new(info: ClientConfig, target: NotifyTarget) -> Self
pub fn new(info: ClientConfig, target: NotifyTarget) -> Self
Create a bridge with the given client info and notify target.
Sourcepub fn with_default_info(upstream_peers: Arc<UpstreamPeerRegistry>) -> Self
pub fn with_default_info(upstream_peers: Arc<UpstreamPeerRegistry>) -> Self
Shared-backend bridge (fan-out / routed progress).
Sourcepub fn for_session(slot: UpstreamPeerSlot) -> Self
pub fn for_session(slot: UpstreamPeerSlot) -> Self
Per-session bridge (1:1 notify to UpstreamPeerSlot).
Sourcepub fn upstream_peers(&self) -> Option<&Arc<UpstreamPeerRegistry>>
pub fn upstream_peers(&self) -> Option<&Arc<UpstreamPeerRegistry>>
Shared upstream peer registry when target is NotifyTarget::Shared.
Sourcepub fn session_slot(&self) -> Option<&UpstreamPeerSlot>
pub fn session_slot(&self) -> Option<&UpstreamPeerSlot>
Session peer slot when target is NotifyTarget::Session.
Trait Implementations§
Source§impl ClientHandler for BackendNotificationBridge
impl ClientHandler for BackendNotificationBridge
fn get_info(&self) -> ClientConfig
async fn on_resource_updated( &self, params: ResourceUpdatedNotificationParam, _context: NotificationContext<RoleClient>, )
async fn on_resource_list_changed( &self, _context: NotificationContext<RoleClient>, )
async fn on_tool_list_changed(&self, _context: NotificationContext<RoleClient>)
async fn on_prompt_list_changed( &self, _context: NotificationContext<RoleClient>, )
async fn on_logging_message( &self, params: LoggingMessageNotificationParam, _context: NotificationContext<RoleClient>, )
async fn on_task_status( &self, params: TaskStatusNotificationParams, _context: NotificationContext<RoleClient>, )
async fn on_progress( &self, params: ProgressNotificationParam, _context: NotificationContext<RoleClient>, )
fn ping( &self, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<(), ErrorData>> + MaybeSendFuture
fn create_message( &self, params: CreateMessageRequestParams, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<CreateMessageResult, ErrorData>> + MaybeSendFuture
fn list_roots( &self, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<ListRootsResult, ErrorData>> + MaybeSendFuture
Source§fn create_elicitation(
&self,
request: ElicitRequestParams,
context: RequestContext<RoleClient>,
) -> impl Future<Output = Result<ElicitResult, ErrorData>> + MaybeSendFuture
fn create_elicitation( &self, request: ElicitRequestParams, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<ElicitResult, ErrorData>> + MaybeSendFuture
Handle an elicitation request from a server asking for user input. Read more
fn on_custom_request( &self, request: CustomRequest, context: RequestContext<RoleClient>, ) -> impl Future<Output = Result<CustomResult, ErrorData>> + MaybeSendFuture
fn on_cancelled( &self, params: CancelledNotificationParam, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_subscriptions_acknowledged( &self, params: SubscriptionsAcknowledgedNotificationParams, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + MaybeSendFuture
fn on_custom_notification( &self, notification: CustomNotification, context: NotificationContext<RoleClient>, ) -> impl Future<Output = ()> + MaybeSendFuture
Source§impl Clone for BackendNotificationBridge
impl Clone for BackendNotificationBridge
Auto Trait Implementations§
impl !RefUnwindSafe for BackendNotificationBridge
impl !UnwindSafe for BackendNotificationBridge
impl Freeze for BackendNotificationBridge
impl Send for BackendNotificationBridge
impl Sync for BackendNotificationBridge
impl Unpin for BackendNotificationBridge
impl UnsafeUnpin for BackendNotificationBridge
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<S> ClientServiceExt for Swhere
S: Service<RoleClient>,
impl<S> ClientServiceExt for Swhere
S: Service<RoleClient>,
fn serve_with_lifecycle<T, E, A>( self, transport: T, lifecycle: ClientLifecycleMode, ) -> impl Future<Output = Result<RunningService<RoleClient, Self>, ClientInitializeError>> + MaybeSendFuture
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<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<H> Service<RoleClient> for Hwhere
H: ClientHandler,
impl<H> Service<RoleClient> for Hwhere
H: ClientHandler,
async fn handle_request( &self, request: <RoleClient as ServiceRole>::PeerReq, context: RequestContext<RoleClient>, ) -> Result<<RoleClient as ServiceRole>::Resp, ErrorData>
async fn handle_notification( &self, notification: <RoleClient as ServiceRole>::PeerNot, context: NotificationContext<RoleClient>, ) -> Result<(), ErrorData>
fn get_info(&self) -> <RoleClient as ServiceRole>::Info
Source§fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
fn supported_protocol_versions(&self) -> Cow<'static, [ProtocolVersion]>
The protocol versions this service can speak, bounding what
initialize
negotiation may agree to. Read moreSource§impl<S> ServiceExt<RoleClient> for Swhere
S: Service<RoleClient>,
impl<S> ServiceExt<RoleClient> for Swhere
S: Service<RoleClient>,
fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<RoleClient, S>, ClientInitializeError>> + 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