pub struct PubSub<C = Pin<Box<dyn AsyncStream + Send + Sync>>>(_);
Expand description
Represents a PubSub
connection.
Implementations
sourceimpl<C> PubSub<C> where
C: Unpin + AsyncRead + AsyncWrite + Send,
impl<C> PubSub<C> where
C: Unpin + AsyncRead + AsyncWrite + Send,
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<'a>(&'a mut self) -> impl Stream<Item = Msg> + 'a
pub fn on_message<'a>(&'a mut self) -> impl Stream<Item = Msg> + 'a
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>
pub async fn into_connection(self) -> Connection<C>
Exits from PubSub
mode and converts PubSub
into Connection
.
Auto Trait Implementations
impl<C = Pin<Box<dyn AsyncStream + Send + Sync + 'static, Global>>> !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 + Send + Sync + 'static, Global>>> !UnwindSafe for PubSub<C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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