Struct generic_db_observer::redis::Redis
source · pub struct Redis {
pub connection: RedisConnection,
pub config: RedisConfig,
}
Expand description
The main Redis message broker structure.
Fields§
§connection: RedisConnection
Connection to the Redis Database.
config: RedisConfig
Configuration to authorize and reach the Redis data.
Implementations§
source§impl Redis
impl Redis
sourcepub fn del(&mut self, key: &str) -> RedisResult<()>
pub fn del(&mut self, key: &str) -> RedisResult<()>
Deletes a key from Redis.
sourcepub fn sadd<S: ToRedisArgs, T: ToRedisArgs>(
&mut self,
key: S,
member: T
) -> RedisResult<()>
pub fn sadd<S: ToRedisArgs, T: ToRedisArgs>( &mut self, key: S, member: T ) -> RedisResult<()>
Adds a member to a set.
sourcepub fn srem<S: ToRedisArgs, T: ToRedisArgs>(
&mut self,
key: S,
member: T
) -> RedisResult<()>
pub fn srem<S: ToRedisArgs, T: ToRedisArgs>( &mut self, key: S, member: T ) -> RedisResult<()>
Removes a member from a set
Trait Implementations§
source§impl MsgListener for Redis
impl MsgListener for Redis
source§async fn subscribe_to_notifications(&mut self) -> Result<(), Self::Error>
async fn subscribe_to_notifications(&mut self) -> Result<(), Self::Error>
Subscribe to the appropriate Redis PubSub channel.
source§async fn notification_stream(&mut self) -> Option<Msg>
async fn notification_stream(&mut self) -> Option<Msg>
This function subscribes to the appropriate PubSub channel and then waits until
source§async fn get_current_state(
&mut self
) -> Result<HashSet<String>, <Self as MsgListener>::Error>
async fn get_current_state( &mut self ) -> Result<HashSet<String>, <Self as MsgListener>::Error>
Get all members of the referenced Redis set.
§type Config = RedisConfig
type Config = RedisConfig
Configuration for connecting to the message broker system.
§type Connection = RedisConnection
type Connection = RedisConnection
Connection interface for the message broker.
§type Error = RedisError
type Error = RedisError
Any Error type returned by operations on the message broker.
Auto Trait Implementations§
impl Freeze for Redis
impl !RefUnwindSafe for Redis
impl Send for Redis
impl Sync for Redis
impl Unpin for Redis
impl !UnwindSafe for Redis
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