pub struct PubSubSink { /* private fields */ }
Expand description
The sink part of a split async Pubsub.
The sink is used to subscribe and unsubscribe from channels. The stream part is independent from the sink, and dropping the sink doesn’t cause the stream part to stop working. The sink isn’t independent from the stream - dropping the stream will cause the sink to return errors on requests.
Implementations§
Source§impl PubSubSink
impl PubSubSink
Sourcepub async fn subscribe(
&mut self,
channel_name: impl ToRedisArgs,
) -> RedisResult<()>
pub async fn subscribe( &mut self, channel_name: impl ToRedisArgs, ) -> RedisResult<()>
Subscribes to a new channel.
Sourcepub async fn unsubscribe(
&mut self,
channel_name: impl ToRedisArgs,
) -> RedisResult<()>
pub async fn unsubscribe( &mut self, channel_name: impl ToRedisArgs, ) -> RedisResult<()>
Unsubscribes from channel.
Sourcepub async fn psubscribe(
&mut self,
channel_pattern: impl ToRedisArgs,
) -> RedisResult<()>
pub async fn psubscribe( &mut self, channel_pattern: impl ToRedisArgs, ) -> RedisResult<()>
Subscribes to a new channel with pattern.
Sourcepub async fn punsubscribe(
&mut self,
channel_pattern: impl ToRedisArgs,
) -> RedisResult<()>
pub async fn punsubscribe( &mut self, channel_pattern: impl ToRedisArgs, ) -> RedisResult<()>
Unsubscribes from channel pattern.
Sourcepub async fn ping_message<T: FromRedisValue>(
&mut self,
message: impl ToRedisArgs,
) -> RedisResult<T>
pub async fn ping_message<T: FromRedisValue>( &mut self, message: impl ToRedisArgs, ) -> RedisResult<T>
Sends a ping with a message to the server
Sourcepub async fn ping<T: FromRedisValue>(&mut self) -> RedisResult<T>
pub async fn ping<T: FromRedisValue>(&mut self) -> RedisResult<T>
Sends a ping to the server
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PubSubSink
impl RefUnwindSafe for PubSubSink
impl Send for PubSubSink
impl Sync for PubSubSink
impl Unpin for PubSubSink
impl UnwindSafe for PubSubSink
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