pub struct StreamManagerNotificationBroadcaster { /* private fields */ }
Expand description
StreamManager-backed notification broadcaster that bridges events to SSE
This implementation converts ALL MCP notification types to proper JSON-RPC format and forwards them to StreamManager for SSE delivery
Implementations§
Source§impl StreamManagerNotificationBroadcaster
impl StreamManagerNotificationBroadcaster
Sourcepub fn new(stream_manager: Arc<StreamManager>) -> Self
pub fn new(stream_manager: Arc<StreamManager>) -> Self
Create new broadcaster that forwards events to StreamManager
Trait Implementations§
Source§impl NotificationBroadcaster for StreamManagerNotificationBroadcaster
impl NotificationBroadcaster for StreamManagerNotificationBroadcaster
Source§fn send_progress_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ProgressNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_progress_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ProgressNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a progress notification (notifications/progress)
Used for long-running operations to show progress updates
Source§fn send_message_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: LoggingMessageNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_message_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: LoggingMessageNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a logging message notification (notifications/message)
Used to send log messages with different levels (debug, info, warning, error)
Source§fn send_resource_updated_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ResourceUpdatedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_resource_updated_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ResourceUpdatedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send resource updated notification (notifications/resources/updated)
Notifies that a specific resource has been updated
Source§fn send_resource_list_changed_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ResourceListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_resource_list_changed_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ResourceListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send resource list changed notification (notifications/resources/list_changed)
Notifies that the resource list has changed (added/removed resources)
Source§fn send_tool_list_changed_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ToolListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_tool_list_changed_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: ToolListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send tool list changed notification (notifications/tools/list_changed)
Notifies that the tool list has changed (added/removed tools)
Source§fn send_prompt_list_changed_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: PromptListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_prompt_list_changed_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: PromptListChangedNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send prompt list changed notification (notifications/prompts/list_changed)
Notifies that the prompt list has changed (added/removed prompts)
Source§fn send_cancelled_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: CancelledNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_cancelled_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: CancelledNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send cancelled notification (notifications/cancelled)
Can be sent by either client or server to cancel a request
Source§fn broadcast_to_all_sessions<'life0, 'async_trait>(
&'life0 self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn broadcast_to_all_sessions<'life0, 'async_trait>(
&'life0 self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Broadcast any JSON-RPC notification to all active sessions (server-wide notifications)
Source§fn send_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_notification<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = Result<(), BroadcastError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send any generic JSON-RPC notification to a specific session
Auto Trait Implementations§
impl Freeze for StreamManagerNotificationBroadcaster
impl !RefUnwindSafe for StreamManagerNotificationBroadcaster
impl Send for StreamManagerNotificationBroadcaster
impl Sync for StreamManagerNotificationBroadcaster
impl Unpin for StreamManagerNotificationBroadcaster
impl !UnwindSafe for StreamManagerNotificationBroadcaster
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