pub struct EventsClient { /* private fields */ }Expand description
ctx.events — the event bus facade.
Implementations§
Source§impl EventsClient
impl EventsClient
Sourcepub async fn publish(
&self,
topic: &str,
payload: Value,
) -> Result<i64, ClientError>
pub async fn publish( &self, topic: &str, payload: Value, ) -> Result<i64, ClientError>
Publish a payload on a topic. Returns the delivered count.
Sourcepub async fn subscribe(
&self,
topic_pattern: &str,
callback: EventCallback,
) -> Result<(), ClientError>
pub async fn subscribe( &self, topic_pattern: &str, callback: EventCallback, ) -> Result<(), ClientError>
Subscribe to a topic pattern; the callback fires for each matched
delivery with the event’s args map (topic, payload, publisher,
timestamp_ms).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for EventsClient
impl !UnwindSafe for EventsClient
impl Freeze for EventsClient
impl Send for EventsClient
impl Sync for EventsClient
impl Unpin for EventsClient
impl UnsafeUnpin for EventsClient
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