Struct redis_async::client::pubsub::PubsubConnection[][src]

pub struct PubsubConnection { /* fields omitted */ }

A shareable reference to subscribe to PUBSUB topics

Implementations

impl PubsubConnection[src]

pub async fn subscribe(&self, topic: &str) -> Result<PubsubStream, Error>[src]

Subscribes to a particular PUBSUB topic.

Returns a future that resolves to a Stream that contains all the messages published on that particular topic.

The resolved stream will end with redis_async::error::Error::EndOfStream if the underlying connection is lost for unexpected reasons. In this situation, clients should subscribe to re-subscribe; the underlying connect will automatically reconnect. However, clients should be aware that resubscriptions will only succeed if the underlying connection has re-established, so multiple calls to subscribe may be required.

pub async fn psubscribe(&self, topic: &str) -> Result<PubsubStream, Error>[src]

pub fn unsubscribe<T: Into<String>>(&self, topic: T)[src]

Tells the client to unsubscribe from a particular topic. This will return immediately, the actual unsubscription will be confirmed when the stream returned from subscribe ends.

pub fn punsubscribe<T: Into<String>>(&self, topic: T)[src]

Trait Implementations

impl Clone for PubsubConnection[src]

impl Debug for PubsubConnection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.