pub struct PubSub { /* private fields */ }Expand description
Adapter-owned PubSub runtime abstraction.
Implementations§
Source§impl PubSub
impl PubSub
Sourcepub fn with_backend<B>(backend: B) -> Selfwhere
B: PubSubBackend + 'static,
pub fn with_backend<B>(backend: B) -> Selfwhere
B: PubSubBackend + 'static,
Wrap a custom backend implementation (for clustered fanout backends).
Sourcepub fn subscribe(&self, topic: impl Into<String>) -> PubSubSubscription
pub fn subscribe(&self, topic: impl Into<String>) -> PubSubSubscription
Subscribe to a topic.
Sourcepub fn broadcast(
&self,
topic: impl Into<String>,
messages: Vec<ServerMessage>,
) -> usize
pub fn broadcast( &self, topic: impl Into<String>, messages: Vec<ServerMessage>, ) -> usize
Broadcast one payload to all subscribers on a topic.
Sourcepub fn capabilities(&self) -> PubSubCapabilities
pub fn capabilities(&self) -> PubSubCapabilities
Backend cluster/delivery capability contract.
Sourcepub fn register_presence(
&self,
topic: impl Into<String>,
session_id: impl Into<String>,
node_id: impl Into<String>,
)
pub fn register_presence( &self, topic: impl Into<String>, session_id: impl Into<String>, node_id: impl Into<String>, )
Register one session as present for a topic on one cluster node.
Sourcepub fn unregister_presence(
&self,
topic: impl Into<String>,
session_id: impl Into<String>,
node_id: impl Into<String>,
)
pub fn unregister_presence( &self, topic: impl Into<String>, session_id: impl Into<String>, node_id: impl Into<String>, )
Unregister one session presence from a topic on one cluster node.
Sourcepub fn presence_snapshot(
&self,
topic: impl Into<String>,
) -> PubSubPresenceSnapshot
pub fn presence_snapshot( &self, topic: impl Into<String>, ) -> PubSubPresenceSnapshot
Return presence counts for one topic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PubSub
impl !RefUnwindSafe for PubSub
impl Send for PubSub
impl Sync for PubSub
impl Unpin for PubSub
impl UnsafeUnpin for PubSub
impl !UnwindSafe for PubSub
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