Struct puff_rs::databases::pubsub::PubSubConnection
source · pub struct PubSubConnection { /* private fields */ }Expand description
A connection that can subscribe to new messages.
Implementations
sourceimpl PubSubConnection
impl PubSubConnection
sourcepub fn who_am_i(&self) -> ConnectionId
pub fn who_am_i(&self) -> ConnectionId
Get the ConnectionId, useful for filtering messages from yourself.
sourcepub fn subscribe<T: Into<Text>>(&self, channel: T) -> BoxFuture<'_, bool>
pub fn subscribe<T: Into<Text>>(&self, channel: T) -> BoxFuture<'_, bool>
Subscribe to the channel. Queues the command even if you don’t await the handle.
sourcepub fn unsubscribe<T: Into<Text>>(&self, channel: T) -> BoxFuture<'_, bool>
pub fn unsubscribe<T: Into<Text>>(&self, channel: T) -> BoxFuture<'_, bool>
Unsubscribe from the channel. Queues the command even if you don’t await the handle.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for PubSubConnection
impl Send for PubSubConnection
impl Sync for PubSubConnection
impl Unpin for PubSubConnection
impl !UnwindSafe for PubSubConnection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more