Trait fred::interfaces::SortedSetsInterface
source · pub trait SortedSetsInterface: ClientLike + Sized {
Show 33 methods
// Provided methods
fn bzmpop<R, K>(
&self,
timeout: f64,
keys: K,
sort: ZCmp,
count: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn bzpopmin<R, K>(
&self,
keys: K,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn bzpopmax<R, K>(
&self,
keys: K,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn zadd<R, K, V>(
&self,
key: K,
options: Option<SetOptions>,
ordering: Option<Ordering>,
changed: bool,
incr: bool,
values: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleZaddValues>,
V::Error: Into<RedisError> { ... }
fn zcard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zcount<R, K>(
&self,
key: K,
min: f64,
max: f64,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zdiff<R, K>(
&self,
keys: K,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn zdiffstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
K: Into<MultipleKeys> { ... }
fn zincrby<R, K, V>(
&self,
key: K,
increment: f64,
member: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn zinter<R, K, W>(
&self,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys>,
W: Into<MultipleWeights> { ... }
fn zinterstore<R, D, K, W>(
&self,
dest: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
K: Into<MultipleKeys>,
W: Into<MultipleWeights> { ... }
fn zlexcount<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zpopmax<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zpopmin<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zmpop<R, K>(
&self,
keys: K,
sort: ZCmp,
count: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn zrandmember<R, K>(
&self,
key: K,
count: Option<(i64, bool)>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zrangestore<R, D, S, M, N>(
&self,
dest: D,
source: S,
min: M,
max: N,
sort: Option<ZSort>,
rev: bool,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
S: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrange<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
sort: Option<ZSort>,
rev: bool,
limit: Option<Limit>,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrangebylex<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrevrangebylex<R, K, M, N>(
&self,
key: K,
max: M,
min: N,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrangebyscore<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
withscores: bool,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrevrangebyscore<R, K, M, N>(
&self,
key: K,
max: M,
min: N,
withscores: bool,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrank<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn zrem<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
fn zremrangebylex<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zremrangebyrank<R, K>(
&self,
key: K,
start: i64,
stop: i64,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zremrangebyscore<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
M: TryInto<ZRange>,
M::Error: Into<RedisError>,
N: TryInto<ZRange>,
N::Error: Into<RedisError> { ... }
fn zrevrange<R, K>(
&self,
key: K,
start: i64,
stop: i64,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn zrevrank<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn zscore<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn zunion<R, K, W>(
&self,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys>,
W: Into<MultipleWeights> { ... }
fn zunionstore<R, D, K, W>(
&self,
dest: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
K: Into<MultipleKeys>,
W: Into<MultipleWeights> { ... }
fn zmscore<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
}i-sorted-sets only.Expand description
Functions that implement the sorted sets interface.
Provided Methods§
sourcefn bzmpop<R, K>(
&self,
timeout: f64,
keys: K,
sort: ZCmp,
count: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
fn bzmpop<R, K>( &self, timeout: f64, keys: K, sort: ZCmp, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
The blocking variant of Self::zmpop.
sourcefn bzpopmin<R, K>(
&self,
keys: K,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
fn bzpopmin<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
The blocking variant of Self::zpopmin.
sourcefn bzpopmax<R, K>(
&self,
keys: K,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
fn bzpopmax<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
The blocking variant of Self::zpopmax.
sourcefn zadd<R, K, V>(
&self,
key: K,
options: Option<SetOptions>,
ordering: Option<Ordering>,
changed: bool,
incr: bool,
values: V,
) -> impl Future<Output = RedisResult<R>>
fn zadd<R, K, V>( &self, key: K, options: Option<SetOptions>, ordering: Option<Ordering>, changed: bool, incr: bool, values: V, ) -> impl Future<Output = RedisResult<R>>
Adds all the specified members with the specified scores to the sorted set stored at key.
sourcefn zcard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
fn zcard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
Returns the sorted set cardinality (number of elements) of the sorted set stored at key.
sourcefn zcount<R, K>(
&self,
key: K,
min: f64,
max: f64,
) -> impl Future<Output = RedisResult<R>>
fn zcount<R, K>( &self, key: K, min: f64, max: f64, ) -> impl Future<Output = RedisResult<R>>
Returns the number of elements in the sorted set at key with a score between min and max.
sourcefn zdiff<R, K>(
&self,
keys: K,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
fn zdiff<R, K>( &self, keys: K, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
This command is similar to ZDIFFSTORE, but instead of storing the resulting sorted set, it is returned to the client.
sourcefn zdiffstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
fn zdiffstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>
Computes the difference between the first and all successive input sorted sets and stores the result in
destination.
sourcefn zincrby<R, K, V>(
&self,
key: K,
increment: f64,
member: V,
) -> impl Future<Output = RedisResult<R>>
fn zincrby<R, K, V>( &self, key: K, increment: f64, member: V, ) -> impl Future<Output = RedisResult<R>>
Increments the score of member in the sorted set stored at key by increment.
sourcefn zinter<R, K, W>(
&self,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
fn zinter<R, K, W>( &self, keys: K, weights: W, aggregate: Option<AggregateOptions>, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
This command is similar to ZINTERSTORE, but instead of storing the resulting sorted set, it is returned to the client.
sourcefn zinterstore<R, D, K, W>(
&self,
dest: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
) -> impl Future<Output = RedisResult<R>>
fn zinterstore<R, D, K, W>( &self, dest: D, keys: K, weights: W, aggregate: Option<AggregateOptions>, ) -> impl Future<Output = RedisResult<R>>
Computes the intersection of the sorted sets given by the specified keys, and stores the result in
destination.
sourcefn zlexcount<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
) -> impl Future<Output = RedisResult<R>>
fn zlexcount<R, K, M, N>( &self, key: K, min: M, max: N, ) -> impl Future<Output = RedisResult<R>>
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.
sourcefn zpopmax<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
fn zpopmax<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
Removes and returns up to count members with the highest scores in the sorted set stored at key.
sourcefn zpopmin<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
fn zpopmin<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
Removes and returns up to count members with the lowest scores in the sorted set stored at key.
sourcefn zmpop<R, K>(
&self,
keys: K,
sort: ZCmp,
count: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
fn zmpop<R, K>( &self, keys: K, sort: ZCmp, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names.
sourcefn zrandmember<R, K>(
&self,
key: K,
count: Option<(i64, bool)>,
) -> impl Future<Output = RedisResult<R>>
fn zrandmember<R, K>( &self, key: K, count: Option<(i64, bool)>, ) -> impl Future<Output = RedisResult<R>>
When called with just the key argument, return a random element from the sorted set value stored at key.
sourcefn zrangestore<R, D, S, M, N>(
&self,
dest: D,
source: S,
min: M,
max: N,
sort: Option<ZSort>,
rev: bool,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
fn zrangestore<R, D, S, M, N>( &self, dest: D, source: S, min: M, max: N, sort: Option<ZSort>, rev: bool, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>
This command is like ZRANGE, but stores the result in the destination key.
sourcefn zrange<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
sort: Option<ZSort>,
rev: bool,
limit: Option<Limit>,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
fn zrange<R, K, M, N>( &self, key: K, min: M, max: N, sort: Option<ZSort>, rev: bool, limit: Option<Limit>, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
Returns the specified range of elements in the sorted set stored at key.
sourcefn zrangebylex<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
fn zrangebylex<R, K, M, N>( &self, key: K, min: M, max: N, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical
ordering, this command returns all the elements in the sorted set at key with a value between min and max.
sourcefn zrevrangebylex<R, K, M, N>(
&self,
key: K,
max: M,
min: N,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
fn zrevrangebylex<R, K, M, N>( &self, key: K, max: M, min: N, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical
ordering, this command returns all the elements in the sorted set at key with a value between max and min.
sourcefn zrangebyscore<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
withscores: bool,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
fn zrangebyscore<R, K, M, N>( &self, key: K, min: M, max: N, withscores: bool, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>
Returns all the elements in the sorted set at key with a score between min and max (including elements
with score equal to min or max).
sourcefn zrevrangebyscore<R, K, M, N>(
&self,
key: K,
max: M,
min: N,
withscores: bool,
limit: Option<Limit>,
) -> impl Future<Output = RedisResult<R>>
fn zrevrangebyscore<R, K, M, N>( &self, key: K, max: M, min: N, withscores: bool, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>
Returns all the elements in the sorted set at key with a score between max and min (including
elements with score equal to max or min).
sourcefn zrank<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
fn zrank<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>
Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.
sourcefn zrem<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn zrem<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Removes the specified members from the sorted set stored at key. Non existing members are ignored.
sourcefn zremrangebylex<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
) -> impl Future<Output = RedisResult<R>>
fn zremrangebylex<R, K, M, N>( &self, key: K, min: M, max: N, ) -> impl Future<Output = RedisResult<R>>
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical
ordering, this command removes all elements in the sorted set stored at key between the lexicographical range
specified by min and max.
sourcefn zremrangebyrank<R, K>(
&self,
key: K,
start: i64,
stop: i64,
) -> impl Future<Output = RedisResult<R>>
fn zremrangebyrank<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
Removes all elements in the sorted set stored at key with rank between start and stop.
sourcefn zremrangebyscore<R, K, M, N>(
&self,
key: K,
min: M,
max: N,
) -> impl Future<Output = RedisResult<R>>
fn zremrangebyscore<R, K, M, N>( &self, key: K, min: M, max: N, ) -> impl Future<Output = RedisResult<R>>
Removes all elements in the sorted set stored at key with a score between min and max.
sourcefn zrevrange<R, K>(
&self,
key: K,
start: i64,
stop: i64,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
fn zrevrange<R, K>( &self, key: K, start: i64, stop: i64, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
Returns the specified range of elements in the sorted set stored at key.
sourcefn zrevrank<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
fn zrevrank<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>
Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
sourcefn zscore<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
fn zscore<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>
Returns the score of member in the sorted set at key.
sourcefn zunion<R, K, W>(
&self,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
withscores: bool,
) -> impl Future<Output = RedisResult<R>>
fn zunion<R, K, W>( &self, keys: K, weights: W, aggregate: Option<AggregateOptions>, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
This command is similar to ZUNIONSTORE, but instead of storing the resulting sorted set, it is returned to the client.
sourcefn zunionstore<R, D, K, W>(
&self,
dest: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>,
) -> impl Future<Output = RedisResult<R>>
fn zunionstore<R, D, K, W>( &self, dest: D, keys: K, weights: W, aggregate: Option<AggregateOptions>, ) -> impl Future<Output = RedisResult<R>>
Computes the union of the sorted sets given by the specified keys, and stores the result in destination.
sourcefn zmscore<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn zmscore<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Returns the scores associated with the specified members in the sorted set stored at key.