pub struct PubSub<C = Pin<Box<dyn AsyncStream + Send + Sync>>>(/* private fields */);
Expand description
Represents a PubSub
connection.
Implementations§
source§impl<C> PubSub<C>
impl<C> PubSub<C>
sourcepub async fn subscribe<T: ToRedisArgs>(&mut self, channel: T) -> RedisResult<()>
pub async fn subscribe<T: ToRedisArgs>(&mut self, channel: T) -> RedisResult<()>
Subscribes to a new channel.
sourcepub async fn psubscribe<T: ToRedisArgs>(
&mut self,
pchannel: T,
) -> RedisResult<()>
pub async fn psubscribe<T: ToRedisArgs>( &mut self, pchannel: T, ) -> RedisResult<()>
Subscribes to a new channel with a pattern.
sourcepub async fn unsubscribe<T: ToRedisArgs>(
&mut self,
channel: T,
) -> RedisResult<()>
pub async fn unsubscribe<T: ToRedisArgs>( &mut self, channel: T, ) -> RedisResult<()>
Unsubscribes from a channel.
sourcepub async fn punsubscribe<T: ToRedisArgs>(
&mut self,
pchannel: T,
) -> RedisResult<()>
pub async fn punsubscribe<T: ToRedisArgs>( &mut self, pchannel: T, ) -> RedisResult<()>
Unsubscribes from a channel with a pattern.
sourcepub fn on_message(&mut self) -> impl Stream<Item = Msg> + '_
pub fn on_message(&mut self) -> impl Stream<Item = Msg> + '_
sourcepub fn into_on_message(self) -> impl Stream<Item = Msg>
pub fn into_on_message(self) -> impl Stream<Item = Msg>
sourcepub async fn into_connection(self) -> Connection<C>
👎Deprecated: aio::Connection is deprecated
pub async fn into_connection(self) -> Connection<C>
Exits from PubSub
mode and converts PubSub
into Connection
.
Auto Trait Implementations§
impl<C> Freeze for PubSub<C>where
C: Freeze,
impl<C = Pin<Box<dyn AsyncStream + Sync + Send>>> !RefUnwindSafe for PubSub<C>
impl<C> Send for PubSub<C>where
C: Send,
impl<C> Sync for PubSub<C>where
C: Sync,
impl<C> Unpin for PubSub<C>where
C: Unpin,
impl<C = Pin<Box<dyn AsyncStream + Sync + Send>>> !UnwindSafe for PubSub<C>
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