pub struct ProgressNotificationSender<F>{ /* private fields */ }Expand description
A notification sender that sends progress notifications via a callback.
This is the server-side implementation used to send notifications back to the client during handler execution. It rejects non-finite numeric fields and serialization failures, and contains callback panics so a reporting failure cannot unwind through the request handler.
The exact-2024 path remains immediate. Final request-owned dispatch can
instead install [FinalProgressRuntime] and retain its explicit flush and
terminal-finalization primitives in the outer transport owner.
Implementations§
Source§impl<F> ProgressNotificationSender<F>
impl<F> ProgressNotificationSender<F>
Sourcepub fn new(marker: ProgressMarker, send_fn: F) -> Self
pub fn new(marker: ProgressMarker, send_fn: F) -> Self
Creates a new progress notification sender.
Sourcepub fn new_final(marker: ProgressMarker, send_fn: F) -> Self
pub fn new_final(marker: ProgressMarker, send_fn: F) -> Self
Creates a progress sender for MCP 2026-07-28 handler dispatch.
Calls made through the ordinary ProgressReporter bridge are
admitted as exact finite JSON numbers and emitted with
FinalProgressNotificationParams. The exact-2024 constructor
Self::new deliberately retains its f64 wire model.
Sourcepub fn into_reporter(self) -> ProgressReporterwhere
Self: 'static,
pub fn into_reporter(self) -> ProgressReporterwhere
Self: 'static,
Creates a progress reporter from this sender.
Trait Implementations§
Source§impl<F> Debug for ProgressNotificationSender<F>
impl<F> Debug for ProgressNotificationSender<F>
Source§impl<F> NotificationSender for ProgressNotificationSender<F>
impl<F> NotificationSender for ProgressNotificationSender<F>
Source§fn send_progress_exact(
&self,
progress: Number,
total: Option<Number>,
message: Option<&str>,
)
fn send_progress_exact( &self, progress: Number, total: Option<Number>, message: Option<&str>, )
Source§fn send_progress(
&self,
progress: f64,
total: Option<f64>,
message: Option<&str>,
)
fn send_progress( &self, progress: f64, total: Option<f64>, message: Option<&str>, )
Source§fn send_log(&self, _level: McpLogLevel, _logger: Option<&str>, _data: Value)
fn send_log(&self, _level: McpLogLevel, _logger: Option<&str>, _data: Value)
notifications/message log frame to the client. Read moreSource§fn send_catalog_changed(&self, _kind: McpCatalogKind)
fn send_catalog_changed(&self, _kind: McpCatalogKind)
list_changed notification after a session mutation. Read moreSource§fn send_resource_updated(&self, _uri: &str)
fn send_resource_updated(&self, _uri: &str)
notifications/resources/updated for one subscribed URI. Read more