pub trait SortedSetCommands {
Show 34 methods
// Provided methods
fn zadd<K, M, I>(
&mut self,
key: K,
items: I,
options: ZAddOptions,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg>,
I: ArgsOrCollection<(f64, M)> { ... }
fn zadd_incr<K, M>(
&mut self,
key: K,
condition: ZAddCondition,
comparison: ZAddComparison,
change: bool,
score: f64,
member: M,
) -> PreparedCommand<'_, Self, Option<f64>>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg> { ... }
fn zcard<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg> { ... }
fn zcount<K, M1, M2>(
&mut self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
M1: Into<CommandArg>,
M2: Into<CommandArg> { ... }
fn zdiff<K, C, E>(&mut self, keys: C) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
E: FromValue { ... }
fn zdiff_with_scores<K, C, E>(
&mut self,
keys: C,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
E: FromValue { ... }
fn zdiffstore<D, K, C>(
&mut self,
destination: D,
keys: C,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
D: Into<CommandArg>,
K: Into<CommandArg>,
C: SingleArgOrCollection<K> { ... }
fn zincrby<K, M>(
&mut self,
key: K,
increment: f64,
member: M,
) -> PreparedCommand<'_, Self, f64>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg> { ... }
fn zinter<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue { ... }
fn zinter_with_scores<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue { ... }
fn zintercard<K, C>(
&mut self,
keys: C,
limit: usize,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K> { ... }
fn zinterstore<D, K, C, W>(
&mut self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
D: Into<CommandArg>,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64> { ... }
fn zlexcount<K, M1, M2>(
&mut self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
M1: Into<CommandArg>,
M2: Into<CommandArg> { ... }
fn zmpop<K, C, E>(
&mut self,
keys: C,
where_: ZWhere,
count: usize,
) -> PreparedCommand<'_, Self, Option<ZMPopResult<E>>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
E: FromValue { ... }
fn zmscore<K, M, C>(
&mut self,
key: K,
members: C,
) -> PreparedCommand<'_, Self, Vec<Option<f64>>>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg>,
C: SingleArgOrCollection<M> { ... }
fn zpopmax<K, M>(
&mut self,
key: K,
count: usize,
) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
where Self: Sized,
K: Into<CommandArg>,
M: FromValue { ... }
fn zpopmin<K, M>(
&mut self,
key: K,
count: usize,
) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
where Self: Sized,
K: Into<CommandArg>,
M: FromValue { ... }
fn zrandmember<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
where Self: Sized,
K: Into<CommandArg>,
E: FromValue { ... }
fn zrandmembers<K, E>(
&mut self,
key: K,
count: isize,
) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized,
K: Into<CommandArg>,
E: FromValue { ... }
fn zrandmembers_with_scores<K, E>(
&mut self,
key: K,
count: isize,
) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized,
K: Into<CommandArg>,
E: FromValue { ... }
fn zrange<K, S, E>(
&mut self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized,
K: Into<CommandArg>,
S: Into<CommandArg>,
E: FromValue { ... }
fn zrange_with_scores<K, S, E>(
&mut self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
where Self: Sized,
K: Into<CommandArg>,
S: Into<CommandArg>,
E: FromValue { ... }
fn zrangestore<D, S, SS>(
&mut self,
dst: D,
src: S,
start: SS,
stop: SS,
options: ZRangeOptions,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
D: Into<CommandArg>,
S: Into<CommandArg>,
SS: Into<CommandArg> { ... }
fn zrank<K, M>(
&mut self,
key: K,
member: M,
) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg> { ... }
fn zrem<K, M, C>(
&mut self,
key: K,
members: C,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg>,
C: SingleArgOrCollection<M> { ... }
fn zremrangebylex<K, S>(
&mut self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
S: Into<CommandArg> { ... }
fn zremrangebyrank<K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg> { ... }
fn zremrangebyscore<K, S>(
&mut self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
S: Into<CommandArg> { ... }
fn zrevrank<K, M>(
&mut self,
key: K,
member: M,
) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg> { ... }
fn zscan<K, M>(
&mut self,
key: K,
cursor: usize,
options: ZScanOptions,
) -> PreparedCommand<'_, Self, (u64, Vec<(M, f64)>)>
where Self: Sized,
K: Into<CommandArg>,
M: FromValue { ... }
fn zscore<K, M>(
&mut self,
key: K,
member: M,
) -> PreparedCommand<'_, Self, Option<f64>>
where Self: Sized,
K: Into<CommandArg>,
M: Into<CommandArg> { ... }
fn zunion<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue { ... }
fn zunion_with_scores<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue { ... }
fn zunionstore<D, K, C, W>(
&mut self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
D: Into<CommandArg>,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64> { ... }
}
Expand description
Provided Methods§
Sourcefn zadd<K, M, I>(
&mut self,
key: K,
items: I,
options: ZAddOptions,
) -> PreparedCommand<'_, Self, usize>
fn zadd<K, M, I>( &mut self, key: K, items: I, options: ZAddOptions, ) -> PreparedCommand<'_, 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>(
&mut self,
key: K,
condition: ZAddCondition,
comparison: ZAddComparison,
change: bool,
score: f64,
member: M,
) -> PreparedCommand<'_, Self, Option<f64>>
fn zadd_incr<K, M>( &mut self, key: K, condition: ZAddCondition, comparison: ZAddComparison, change: bool, score: f64, member: M, ) -> PreparedCommand<'_, Self, Option<f64>>
Sourcefn zcard<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
fn zcard<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
Sourcefn zcount<K, M1, M2>(
&mut self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'_, Self, usize>
fn zcount<K, M1, M2>( &mut self, key: K, min: M1, max: M2, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zdiff<K, C, E>(&mut self, keys: C) -> PreparedCommand<'_, Self, Vec<E>>
fn zdiff<K, C, E>(&mut self, keys: C) -> PreparedCommand<'_, Self, Vec<E>>
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>(
&mut self,
keys: C,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
fn zdiff_with_scores<K, C, E>( &mut self, keys: C, ) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
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>(
&mut self,
destination: D,
keys: C,
) -> PreparedCommand<'_, Self, usize>
fn zdiffstore<D, K, C>( &mut self, destination: D, keys: C, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zincrby<K, M>(
&mut self,
key: K,
increment: f64,
member: M,
) -> PreparedCommand<'_, Self, f64>
fn zincrby<K, M>( &mut self, key: K, increment: f64, member: M, ) -> PreparedCommand<'_, Self, f64>
Sourcefn zinter<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<E>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
fn zinter<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<E>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
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>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
fn zinter_with_scores<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
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>(
&mut self,
keys: C,
limit: usize,
) -> PreparedCommand<'_, Self, usize>
fn zintercard<K, C>( &mut self, keys: C, limit: usize, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zinterstore<D, K, C, W>(
&mut self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
D: Into<CommandArg>,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
fn zinterstore<D, K, C, W>(
&mut self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
D: Into<CommandArg>,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
Sourcefn zlexcount<K, M1, M2>(
&mut self,
key: K,
min: M1,
max: M2,
) -> PreparedCommand<'_, Self, usize>
fn zlexcount<K, M1, M2>( &mut self, key: K, min: M1, max: M2, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zmpop<K, C, E>(
&mut self,
keys: C,
where_: ZWhere,
count: usize,
) -> PreparedCommand<'_, Self, Option<ZMPopResult<E>>>
fn zmpop<K, C, E>( &mut self, keys: C, where_: ZWhere, count: usize, ) -> PreparedCommand<'_, Self, Option<ZMPopResult<E>>>
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>(
&mut self,
key: K,
members: C,
) -> PreparedCommand<'_, Self, Vec<Option<f64>>>
fn zmscore<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<Option<f64>>>
Sourcefn zpopmax<K, M>(
&mut self,
key: K,
count: usize,
) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
fn zpopmax<K, M>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
Sourcefn zpopmin<K, M>(
&mut self,
key: K,
count: usize,
) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
fn zpopmin<K, M>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
Sourcefn zrandmember<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
fn zrandmember<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
Sourcefn zrandmembers<K, E>(
&mut self,
key: K,
count: isize,
) -> PreparedCommand<'_, Self, Vec<E>>
fn zrandmembers<K, E>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, 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>(
&mut self,
key: K,
count: isize,
) -> PreparedCommand<'_, Self, Vec<E>>
fn zrandmembers_with_scores<K, E>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, 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>(
&mut self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'_, Self, Vec<E>>
fn zrange<K, S, E>( &mut self, key: K, start: S, stop: S, options: ZRangeOptions, ) -> PreparedCommand<'_, Self, Vec<E>>
Sourcefn zrange_with_scores<K, S, E>(
&mut self,
key: K,
start: S,
stop: S,
options: ZRangeOptions,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
fn zrange_with_scores<K, S, E>( &mut self, key: K, start: S, stop: S, options: ZRangeOptions, ) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
Sourcefn zrangestore<D, S, SS>(
&mut self,
dst: D,
src: S,
start: SS,
stop: SS,
options: ZRangeOptions,
) -> PreparedCommand<'_, Self, usize>
fn zrangestore<D, S, SS>( &mut self, dst: D, src: S, start: SS, stop: SS, options: ZRangeOptions, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zrank<K, M>(
&mut self,
key: K,
member: M,
) -> PreparedCommand<'_, Self, Option<usize>>
fn zrank<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, Option<usize>>
Sourcefn zrem<K, M, C>(
&mut self,
key: K,
members: C,
) -> PreparedCommand<'_, Self, usize>
fn zrem<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zremrangebylex<K, S>(
&mut self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'_, Self, usize>
fn zremrangebylex<K, S>( &mut self, key: K, start: S, stop: S, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zremrangebyrank<K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> PreparedCommand<'_, Self, usize>
fn zremrangebyrank<K>( &mut self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zremrangebyscore<K, S>(
&mut self,
key: K,
start: S,
stop: S,
) -> PreparedCommand<'_, Self, usize>
fn zremrangebyscore<K, S>( &mut self, key: K, start: S, stop: S, ) -> PreparedCommand<'_, Self, usize>
Sourcefn zrevrank<K, M>(
&mut self,
key: K,
member: M,
) -> PreparedCommand<'_, Self, Option<usize>>
fn zrevrank<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, Option<usize>>
Sourcefn zscan<K, M>(
&mut self,
key: K,
cursor: usize,
options: ZScanOptions,
) -> PreparedCommand<'_, Self, (u64, Vec<(M, f64)>)>
fn zscan<K, M>( &mut self, key: K, cursor: usize, options: ZScanOptions, ) -> PreparedCommand<'_, Self, (u64, Vec<(M, f64)>)>
Sourcefn zscore<K, M>(
&mut self,
key: K,
member: M,
) -> PreparedCommand<'_, Self, Option<f64>>
fn zscore<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, Option<f64>>
Sourcefn zunion<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<E>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
fn zunion<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<E>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
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>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
fn zunion_with_scores<K, C, W, E>(
&mut self,
keys: C,
weights: Option<W>,
aggregate: ZAggregate,
) -> PreparedCommand<'_, Self, Vec<(E, f64)>>where
Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
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