pub trait SortedSetCommands<'a> {
Show 34 methods
// Provided methods
fn zadd<K, M, I>(
self,
key: K,
items: I,
options: ZAddOptions,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
M: SingleArg,
I: MultipleArgsCollection<(f64, M)> { ... }
fn zadd_incr<K, M>(
self,
key: K,
condition: ZAddCondition,
comparison: ZAddComparison,
change: bool,
score: f64,
member: M,
) -> PreparedCommand<'a, Self, Option<f64>>
where Self: Sized,
K: SingleArg,
M: SingleArg { ... }
fn zcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg { ... }
fn zcount<K, M1, M2>(
self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
M1: SingleArg,
M2: SingleArg { ... }
fn zdiff<K, C, E>(self, keys: C) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zdiff_with_scores<K, C, E>(
self,
keys: C,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zdiffstore<D, K, C>(
self,
destination: D,
keys: C,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
D: SingleArg,
K: SingleArg,
C: SingleArgCollection<K> { ... }
fn zincrby<K, M>(
self,
key: K,
increment: f64,
member: M,
) -> PreparedCommand<'a, Self, f64>
where Self: Sized,
K: SingleArg,
M: SingleArg { ... }
fn zinter<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zinter_with_scores<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zintercard<K, C>(
self,
keys: C,
limit: usize,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K> { ... }
fn zinterstore<D, K, C, W>(
self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
D: SingleArg,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64> { ... }
fn zlexcount<K, M1, M2>(
self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
M1: SingleArg,
M2: SingleArg { ... }
fn zmpop<K, C, E>(
self,
keys: C,
where_: ZWhere,
count: usize,
) -> PreparedCommand<'a, Self, Option<ZMPopResult<E>>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zmscore<K, M, C>(
self,
key: K,
members: C,
) -> PreparedCommand<'a, Self, Vec<Option<f64>>>
where Self: Sized,
K: SingleArg,
M: SingleArg,
C: SingleArgCollection<M> { ... }
fn zpopmax<K, M>(
self,
key: K,
count: usize,
) -> PreparedCommand<'a, Self, Vec<(M, f64)>>
where Self: Sized,
K: SingleArg,
M: PrimitiveResponse + DeserializeOwned { ... }
fn zpopmin<K, M>(
self,
key: K,
count: usize,
) -> PreparedCommand<'a, Self, Vec<(M, f64)>>
where Self: Sized,
K: SingleArg,
M: PrimitiveResponse + DeserializeOwned { ... }
fn zrandmember<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
where Self: Sized,
K: SingleArg,
E: PrimitiveResponse { ... }
fn zrandmembers<K, E>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized,
K: SingleArg,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zrandmembers_with_scores<K, E>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized,
K: SingleArg,
E: DeserializeOwned { ... }
fn zrange<K, S, E>(
self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized,
K: SingleArg,
S: SingleArg,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zrange_with_scores<K, S, E>(
self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>
where Self: Sized,
K: SingleArg,
S: SingleArg,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zrangestore<D, S, SS>(
self,
dst: D,
src: S,
start: SS,
stop: SS,
options: ZRangeOptions,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
D: SingleArg,
S: SingleArg,
SS: SingleArg { ... }
fn zrank<K, M>(
self,
key: K,
member: M,
) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized,
K: SingleArg,
M: SingleArg { ... }
fn zrem<K, M, C>(
self,
key: K,
members: C,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
M: SingleArg,
C: SingleArgCollection<M> { ... }
fn zremrangebylex<K, S>(
self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
S: SingleArg { ... }
fn zremrangebyrank<K>(
self,
key: K,
start: isize,
stop: isize,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg { ... }
fn zremrangebyscore<K, S>(
self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
S: SingleArg { ... }
fn zrevrank<K, M>(
self,
key: K,
member: M,
) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized,
K: SingleArg,
M: SingleArg { ... }
fn zscan<K, M>(
self,
key: K,
cursor: usize,
options: ZScanOptions,
) -> PreparedCommand<'a, Self, ZScanResult<M>>
where Self: Sized,
K: SingleArg,
M: PrimitiveResponse + DeserializeOwned { ... }
fn zscore<K, M>(
self,
key: K,
member: M,
) -> PreparedCommand<'a, Self, Option<f64>>
where Self: Sized,
K: SingleArg,
M: SingleArg { ... }
fn zunion<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zunion_with_scores<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned { ... }
fn zunionstore<D, K, C, W>(
self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
D: SingleArg,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64> { ... }
}
Expand description
Provided Methods§
Sourcefn zadd<K, M, I>(
self,
key: K,
items: I,
options: ZAddOptions,
) -> PreparedCommand<'a, Self, usize>
fn zadd<K, M, I>( self, key: K, items: I, options: ZAddOptions, ) -> PreparedCommand<'a, Self, usize>
Adds all the specified members with the specified scores to the sorted set stored at key.
§Return
- When used without optional arguments, the number of elements added to the sorted set (excluding score updates).
- If the
change
option is specified, the number of elements that were changed (added or updated).
§See Also
Sourcefn zadd_incr<K, M>(
self,
key: K,
condition: ZAddCondition,
comparison: ZAddComparison,
change: bool,
score: f64,
member: M,
) -> PreparedCommand<'a, Self, Option<f64>>
fn zadd_incr<K, M>( self, key: K, condition: ZAddCondition, comparison: ZAddComparison, change: bool, score: f64, member: M, ) -> PreparedCommand<'a, Self, Option<f64>>
Sourcefn zcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
fn zcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
Sourcefn zcount<K, M1, M2>(
self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'a, Self, usize>
fn zcount<K, M1, M2>( self, key: K, min: M1, max: M2, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zdiff<K, C, E>(self, keys: C) -> PreparedCommand<'a, Self, Vec<E>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned,
fn zdiff<K, C, E>(self, keys: C) -> PreparedCommand<'a, Self, Vec<E>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned,
This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client.
§Return
The result of the difference
§See Also
Sourcefn zdiff_with_scores<K, C, E>(
self,
keys: C,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned,
fn zdiff_with_scores<K, C, E>(
self,
keys: C,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned,
This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client.
§Return
The result of the difference with their scores
§See Also
Sourcefn zdiffstore<D, K, C>(
self,
destination: D,
keys: C,
) -> PreparedCommand<'a, Self, usize>
fn zdiffstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zincrby<K, M>(
self,
key: K,
increment: f64,
member: M,
) -> PreparedCommand<'a, Self, f64>
fn zincrby<K, M>( self, key: K, increment: f64, member: M, ) -> PreparedCommand<'a, Self, f64>
Sourcefn zinter<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<E>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
fn zinter<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<E>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client.
§Return
The result of the intersection as an array of members
§See Also
Sourcefn zinter_with_scores<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
fn zinter_with_scores<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client.
§Return
The result of the intersection as an array of members with their scores
§See Also
Sourcefn zintercard<K, C>(
self,
keys: C,
limit: usize,
) -> PreparedCommand<'a, Self, usize>
fn zintercard<K, C>( self, keys: C, limit: usize, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zinterstore<D, K, C, W>(
self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, usize>where
Self: Sized,
D: SingleArg,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
fn zinterstore<D, K, C, W>(
self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, usize>where
Self: Sized,
D: SingleArg,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
Sourcefn zlexcount<K, M1, M2>(
self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'a, Self, usize>
fn zlexcount<K, M1, M2>( self, key: K, min: M1, max: M2, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zmpop<K, C, E>(
self,
keys: C,
where_: ZWhere,
count: usize,
) -> PreparedCommand<'a, Self, Option<ZMPopResult<E>>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned,
fn zmpop<K, C, E>(
self,
keys: C,
where_: ZWhere,
count: usize,
) -> PreparedCommand<'a, Self, Option<ZMPopResult<E>>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
E: PrimitiveResponse + DeserializeOwned,
Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names.
§Return
- None if no element could be popped
- A tuple made up of
- The name of the key from which elements were popped
- An array of tuples with all the popped members and their scores
§See Also
Sourcefn zmscore<K, M, C>(
self,
key: K,
members: C,
) -> PreparedCommand<'a, Self, Vec<Option<f64>>>
fn zmscore<K, M, C>( self, key: K, members: C, ) -> PreparedCommand<'a, Self, Vec<Option<f64>>>
Sourcefn zpopmax<K, M>(
self,
key: K,
count: usize,
) -> PreparedCommand<'a, Self, Vec<(M, f64)>>
fn zpopmax<K, M>( self, key: K, count: usize, ) -> PreparedCommand<'a, Self, Vec<(M, f64)>>
Sourcefn zpopmin<K, M>(
self,
key: K,
count: usize,
) -> PreparedCommand<'a, Self, Vec<(M, f64)>>
fn zpopmin<K, M>( self, key: K, count: usize, ) -> PreparedCommand<'a, Self, Vec<(M, f64)>>
Sourcefn zrandmember<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
fn zrandmember<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
Sourcefn zrandmembers<K, E>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, Vec<E>>
fn zrandmembers<K, E>( self, key: K, count: isize, ) -> PreparedCommand<'a, Self, Vec<E>>
Return random elements from the sorted set value stored at key.
§Return
- If the provided count argument is positive, return an array of distinct elements. The array’s length is either count or the sorted set’s cardinality (ZCARD), whichever is lower.
- If called with a negative count, the behavior changes and the command is allowed to return the same element multiple times. In this case, the number of returned elements is the absolute value of the specified count.
§See Also
Sourcefn zrandmembers_with_scores<K, E>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, Vec<E>>
fn zrandmembers_with_scores<K, E>( self, key: K, count: isize, ) -> PreparedCommand<'a, Self, Vec<E>>
Return random elements with their scores from the sorted set value stored at key.
§Return
- If the provided count argument is positive, return an array of distinct elements with their scores. The array’s length is either count or the sorted set’s cardinality (ZCARD), whichever is lower.
- If called with a negative count, the behavior changes and the command is allowed to return the same element multiple times. In this case, the number of returned elements is the absolute value of the specified count.
§See Also
Sourcefn zrange<K, S, E>(
self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'a, Self, Vec<E>>
fn zrange<K, S, E>( self, key: K, start: S, stop: S, options: ZRangeOptions, ) -> PreparedCommand<'a, Self, Vec<E>>
Sourcefn zrange_with_scores<K, S, E>(
self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>
fn zrange_with_scores<K, S, E>( self, key: K, start: S, stop: S, options: ZRangeOptions, ) -> PreparedCommand<'a, Self, Vec<(E, f64)>>
Sourcefn zrangestore<D, S, SS>(
self,
dst: D,
src: S,
start: SS,
stop: SS,
options: ZRangeOptions,
) -> PreparedCommand<'a, Self, usize>
fn zrangestore<D, S, SS>( self, dst: D, src: S, start: SS, stop: SS, options: ZRangeOptions, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zrank<K, M>(
self,
key: K,
member: M,
) -> PreparedCommand<'a, Self, Option<usize>>
fn zrank<K, M>( self, key: K, member: M, ) -> PreparedCommand<'a, Self, Option<usize>>
Sourcefn zrem<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
fn zrem<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
Sourcefn zremrangebylex<K, S>(
self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'a, Self, usize>
fn zremrangebylex<K, S>( self, key: K, start: S, stop: S, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zremrangebyrank<K>(
self,
key: K,
start: isize,
stop: isize,
) -> PreparedCommand<'a, Self, usize>
fn zremrangebyrank<K>( self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zremrangebyscore<K, S>(
self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'a, Self, usize>
fn zremrangebyscore<K, S>( self, key: K, start: S, stop: S, ) -> PreparedCommand<'a, Self, usize>
Sourcefn zrevrank<K, M>(
self,
key: K,
member: M,
) -> PreparedCommand<'a, Self, Option<usize>>
fn zrevrank<K, M>( self, key: K, member: M, ) -> PreparedCommand<'a, Self, Option<usize>>
Sourcefn zscan<K, M>(
self,
key: K,
cursor: usize,
options: ZScanOptions,
) -> PreparedCommand<'a, Self, ZScanResult<M>>
fn zscan<K, M>( self, key: K, cursor: usize, options: ZScanOptions, ) -> PreparedCommand<'a, Self, ZScanResult<M>>
Sourcefn zscore<K, M>(
self,
key: K,
member: M,
) -> PreparedCommand<'a, Self, Option<f64>>
fn zscore<K, M>( self, key: K, member: M, ) -> PreparedCommand<'a, Self, Option<f64>>
Sourcefn zunion<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<E>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
fn zunion<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<E>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client.
§Return
The result of the unionsection as an array of members
§See Also
Sourcefn zunion_with_scores<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
fn zunion_with_scores<K, C, W, E>(
self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'a, Self, Vec<(E, f64)>>where
Self: Sized,
K: SingleArg,
C: SingleArgCollection<K>,
W: SingleArgCollection<f64>,
E: PrimitiveResponse + DeserializeOwned,
This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client.
§Return
The result of the unionsection as an array of members with their scores