pub struct PubSubBroker { /* private fields */ }Expand description
Pub/sub broker
Implementations§
Source§impl PubSubBroker
impl PubSubBroker
Sourcepub fn with_buffer_size(self, size: usize) -> Self
pub fn with_buffer_size(self, size: usize) -> Self
Configure buffer size
Sourcepub async fn publish(&self, topic: &str, message: Message) -> Result<()>
pub async fn publish(&self, topic: &str, message: Message) -> Result<()>
Publish message to topic
Sourcepub async fn unsubscribe_all(&self, topic: &str)
pub async fn unsubscribe_all(&self, topic: &str)
Unsubscribe all from topic
Sourcepub async fn subscriber_count(&self, topic: &str) -> usize
pub async fn subscriber_count(&self, topic: &str) -> usize
Get topic subscriber count
Sourcepub async fn list_topics(&self) -> Vec<String>
pub async fn list_topics(&self) -> Vec<String>
List all topics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PubSubBroker
impl !RefUnwindSafe for PubSubBroker
impl Send for PubSubBroker
impl Sync for PubSubBroker
impl Unpin for PubSubBroker
impl !UnwindSafe for PubSubBroker
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