Trait bitbazaar::redis::RedisBatchReturningOps
source · pub trait RedisBatchReturningOps<'c> {
type NextType<T>;
// Required methods
fn script<ScriptOutput: FromRedisValue>(
self,
script_invokation: RedisScriptInvoker<'c>,
) -> Self::NextType<ScriptOutput>;
fn exists(self, namespace: &str, key: &str) -> Self::NextType<bool>;
fn mexists<'key>(
self,
namespace: &str,
keys: impl IntoIterator<Item = &'key str>,
) -> Self::NextType<Vec<bool>>;
fn get<Value: FromRedisValue>(
self,
namespace: &str,
key: &str,
) -> Self::NextType<Option<Value>>;
fn mget<Value>(
self,
namespace: &str,
keys: impl IntoIterator<Item = impl AsRef<str>>,
) -> Self::NextType<Vec<Option<Value>>>;
fn zrangebyscore_high_to_low<Value: FromRedisValue>(
self,
set_namespace: &str,
set_key: &str,
min: i64,
max: i64,
limit: Option<isize>,
) -> Self::NextType<Vec<(Option<Value>, i64)>>;
fn zrangebyscore_low_to_high<Value: FromRedisValue>(
self,
set_namespace: &str,
set_key: &str,
min: i64,
max: i64,
limit: Option<isize>,
) -> Self::NextType<Vec<(Option<Value>, i64)>>;
}Expand description
Implements all the supported redis operations that need to modify the return type and hence need macros.
Required Associated Types§
Required Methods§
sourcefn script<ScriptOutput: FromRedisValue>(
self,
script_invokation: RedisScriptInvoker<'c>,
) -> Self::NextType<ScriptOutput>
fn script<ScriptOutput: FromRedisValue>( self, script_invokation: RedisScriptInvoker<'c>, ) -> Self::NextType<ScriptOutput>
Run an arbitrary redis (lua script).
sourcefn mexists<'key>(
self,
namespace: &str,
keys: impl IntoIterator<Item = &'key str>,
) -> Self::NextType<Vec<bool>>
fn mexists<'key>( self, namespace: &str, keys: impl IntoIterator<Item = &'key str>, ) -> Self::NextType<Vec<bool>>
Check if multiple keys exists.
sourcefn get<Value: FromRedisValue>(
self,
namespace: &str,
key: &str,
) -> Self::NextType<Option<Value>>
fn get<Value: FromRedisValue>( self, namespace: &str, key: &str, ) -> Self::NextType<Option<Value>>
Get a value from a key. Returning None if the key doesn’t exist.
sourcefn mget<Value>(
self,
namespace: &str,
keys: impl IntoIterator<Item = impl AsRef<str>>,
) -> Self::NextType<Vec<Option<Value>>>
fn mget<Value>( self, namespace: &str, keys: impl IntoIterator<Item = impl AsRef<str>>, ) -> Self::NextType<Vec<Option<Value>>>
Get multiple values (MGET) of the same type at once. Returning None for each key that didn’t exist.
sourcefn zrangebyscore_high_to_low<Value: FromRedisValue>(
self,
set_namespace: &str,
set_key: &str,
min: i64,
max: i64,
limit: Option<isize>,
) -> Self::NextType<Vec<(Option<Value>, i64)>>
fn zrangebyscore_high_to_low<Value: FromRedisValue>( self, set_namespace: &str, set_key: &str, min: i64, max: i64, limit: Option<isize>, ) -> Self::NextType<Vec<(Option<Value>, i64)>>
HIGHEST TO LOWEST SCORES.
Retrieve entries from an ordered set by score range. (range is inclusive)
Items that cannot be decoded into the specified type are returned as None.
VARIATIONS FROM DEFAULT:
- Rev used: returned high to low.
Arguments:
set_namespace: The namespace of the set.set_key: The key of the set.min: The minimum score.max: The maximum score.limit: The maximum number of items to return.
https://redis.io/commands/zrangebyscore/
sourcefn zrangebyscore_low_to_high<Value: FromRedisValue>(
self,
set_namespace: &str,
set_key: &str,
min: i64,
max: i64,
limit: Option<isize>,
) -> Self::NextType<Vec<(Option<Value>, i64)>>
fn zrangebyscore_low_to_high<Value: FromRedisValue>( self, set_namespace: &str, set_key: &str, min: i64, max: i64, limit: Option<isize>, ) -> Self::NextType<Vec<(Option<Value>, i64)>>
LOWEST TO HIGHEST SCORES.
Retrieve entries from an ordered set by score range. (range is inclusive)
Items that cannot be decoded into the specified type are returned as None.
Arguments:
set_namespace: The namespace of the set.set_key: The key of the set.min: The minimum score.max: The maximum score.limit: The maximum number of items to return.
https://redis.io/commands/zrangebyscore/