StreamManagerNotificationBroadcaster

Struct StreamManagerNotificationBroadcaster 

Source
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

Source

pub fn new(stream_manager: Arc<StreamManager>) -> Self

Create new broadcaster that forwards events to StreamManager

Trait Implementations§

Source§

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,

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,

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,

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,

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,

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,

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,

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,

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,

Send any generic JSON-RPC notification to a specific session

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more