pub struct EventPublisher { /* private fields */ }Expand description
Event publisher for sending events to the bus.
Implementations§
Source§impl EventPublisher
impl EventPublisher
Sourcepub fn progress(
&self,
resource_id: &str,
current: u64,
total: u64,
message: &str,
)
pub fn progress( &self, resource_id: &str, current: u64, total: u64, message: &str, )
Publish a progress event.
Sourcepub fn mcp_progress(
&self,
progress_token: &str,
progress: f64,
total: Option<f64>,
message: Option<&str>,
)
pub fn mcp_progress( &self, progress_token: &str, progress: f64, total: Option<f64>, message: Option<&str>, )
Publish an MCP-compatible progress notification.
The event body follows the notifications/progress schema used by
Claude MCP, OpenAI Agents SDK, Cursor, Cline, and other agent
frameworks, so it can be forwarded verbatim without translation.
§Arguments
progress_token– opaque token identifying the in-progress operation.progress– units of work completed.total– total units, orNonefor indeterminate progress.message– optional human-readable status string.
Sourcepub fn task_started(&self, task_id: &str, data: Value)
pub fn task_started(&self, task_id: &str, data: Value)
Publish a task started event.
Sourcepub fn task_completed(&self, task_id: &str, result: Value)
pub fn task_completed(&self, task_id: &str, result: Value)
Publish a task completed event.
Sourcepub fn task_failed(&self, task_id: &str, error: &str)
pub fn task_failed(&self, task_id: &str, error: &str)
Publish a task failed event.
Sourcepub fn task_cancelled(&self, task_id: &str)
pub fn task_cancelled(&self, task_id: &str)
Publish a task cancelled event.
Trait Implementations§
Source§impl Clone for EventPublisher
impl Clone for EventPublisher
Source§fn clone(&self) -> EventPublisher
fn clone(&self) -> EventPublisher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventPublisher
impl !RefUnwindSafe for EventPublisher
impl Send for EventPublisher
impl Sync for EventPublisher
impl Unpin for EventPublisher
impl UnsafeUnpin for EventPublisher
impl !UnwindSafe for EventPublisher
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<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> IntoMetered for T
impl<T> IntoMetered for T
Source§fn metered(self, metrics: Arc<ChannelMetrics>) -> MeteredSender<Self>
fn metered(self, metrics: Arc<ChannelMetrics>) -> MeteredSender<Self>
Wrap this sender with metrics tracking.
Source§impl<T> WithMetrics for T
impl<T> WithMetrics for T
Source§fn with_metrics(self) -> MeteredWrapper<Self>
fn with_metrics(self) -> MeteredWrapper<Self>
Wrap this channel with metrics tracking.