pub struct Redis {
pub url: String,
pub client: Option<Client>,
}Fields§
§url: String§client: Option<Client>Trait Implementations§
Source§impl CacheProvider for Rediswhere
Redis: Connectable,
impl CacheProvider for Rediswhere
Redis: Connectable,
fn get( &self, cache_space: CacheSpace, key: &str, app_name: Option<String>, ) -> String
fn set( &self, cache_space: CacheSpace, key: &str, value: Value, app_name: Option<String>, )
fn delete(&self, cache_space: CacheSpace, key: &str, app_name: Option<String>)
Source§fn set_with_ttl(
&self,
cache_space: CacheSpace,
key: &str,
value: Value,
app_name: Option<String>,
ttl_secs: u64,
)
fn set_with_ttl( &self, cache_space: CacheSpace, key: &str, value: Value, app_name: Option<String>, ttl_secs: u64, )
Set a key with an explicit TTL in seconds. Defaults to
set (no expiry) if not overridden.fn get_key_name( &self, cache_space: CacheSpace, key: &str, app_name: Option<String>, ) -> String
fn get_value(&self, app_name: Option<String>, value: Value) -> CacheValue<Value>
Source§impl Connectable for Redis
impl Connectable for Redis
fn set_client(&mut self)
fn get_connection(&self) -> &Client
fn get_mut_connection(&mut self) -> &mut Client
Source§impl FifoProvider for Rediswhere
Redis: Connectable,
impl FifoProvider for Rediswhere
Redis: Connectable,
fn pop( &self, channel_name: ListChannel, job_key: &str, ) -> Result<ListMessage, &'static str>
fn push(&self, channel_name: ListChannel, job_key: &str, job_payload: Value)
fn get_list_name(&self, channel_name: &str, job_key: &str) -> String
Source§impl PubSubProvider for Rediswhere
Redis: Connectable,
impl PubSubProvider for Rediswhere
Redis: Connectable,
type Channels = SubscriptionChannel
fn subscribe( &self, callback: AsyncCallback<ChannelMessage>, channel: Self::Channels, ) -> Pin<Box<dyn Future<Output = Result<(), PubSubProviderError>> + Send + '_>>
fn publish(&mut self, channel: Self::Channels, message: ChannelMessage)
Source§impl SortedSetProvider for Rediswhere
Redis: Connectable,
impl SortedSetProvider for Rediswhere
Redis: Connectable,
Source§fn zadd(&self, key: &str, score: f64, member: &str) -> Result<u32, &'static str>
fn zadd(&self, key: &str, score: f64, member: &str) -> Result<u32, &'static str>
Add a member with the given score. Returns the number of new elements added.
Source§fn zremrangebyscore(
&self,
key: &str,
min: f64,
max: f64,
) -> Result<u32, &'static str>
fn zremrangebyscore( &self, key: &str, min: f64, max: f64, ) -> Result<u32, &'static str>
Remove all members with scores between min and max (inclusive).
Returns the number of removed members.
Source§fn zcard(&self, key: &str) -> Result<u32, &'static str>
fn zcard(&self, key: &str) -> Result<u32, &'static str>
Return the number of members in the sorted set.
Source§fn zrangebyscore_withscores(
&self,
key: &str,
min: f64,
max: f64,
limit: Option<usize>,
) -> Result<Vec<(String, f64)>, &'static str>
fn zrangebyscore_withscores( &self, key: &str, min: f64, max: f64, limit: Option<usize>, ) -> Result<Vec<(String, f64)>, &'static str>
Return members with scores in the given range, ordered by score ascending.
Includes scores in the result as
(member, score) pairs.Auto Trait Implementations§
impl Freeze for Redis
impl RefUnwindSafe for Redis
impl Send for Redis
impl Sync for Redis
impl Unpin for Redis
impl UnsafeUnpin 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