[−][src]Struct redis_async::client::pubsub::PubsubConnection
A shareable reference to subscribe to PUBSUB topics
Implementations
impl PubsubConnection
[src]
pub async fn subscribe<'_, '_>(
&'_ self,
topic: &'_ str
) -> Result<PubsubStream, Error>
[src]
&'_ self,
topic: &'_ str
) -> Result<PubsubStream, Error>
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]
&'_ self,
topic: &'_ str
) -> Result<PubsubStream, Error>
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]
pub fn clone(&self) -> PubsubConnection
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PubsubConnection
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,