pub struct RedisSub { /* private fields */ }
Expand description
Redis subscription object. This connects to the Redis server.
Implementations§
Source§impl RedisSub
impl RedisSub
Sourcepub fn new(addr: &str) -> Self
pub fn new(addr: &str) -> Self
Create the new Redis client.
This does not connect to the server, use .listen()
for that.
Sourcepub async fn unsubscribe(&self, channel: String) -> Result<()>
pub async fn unsubscribe(&self, channel: String) -> Result<()>
Unsubscribe from a channel.
§Errors
Returns an error if an error happens on the underlying TCP stream.
Sourcepub async fn psubscribe(&self, channel: String) -> Result<()>
pub async fn psubscribe(&self, channel: String) -> Result<()>
Subscribe to a pattern of channels.
§Errors
Returns an error if an error happens on the underlying TCP stream.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RedisSub
impl !RefUnwindSafe for RedisSub
impl Send for RedisSub
impl Sync for RedisSub
impl Unpin for RedisSub
impl !UnwindSafe for RedisSub
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