pub struct Cmd { /* private fields */ }Expand description
Represents redis commands.
Implementations
impl Cmd
impl Cmd
A command acts as a builder interface to creating encoded redis requests. This allows you to easiy assemble a packed command by chaining arguments together.
Basic example:
redis::Cmd::new().arg("SET").arg("my_key").arg(42);There is also a helper function called cmd which makes it a
tiny bit shorter:
redis::cmd("SET").arg("my_key").arg(42);Because currently rust’s currently does not have an ideal system for lifetimes of temporaries, sometimes you need to hold on to the initially generated command:
let mut cmd = redis::cmd("SMEMBERS");
let mut iter : redis::Iter<i32> = cmd.arg("my_set").clone().iter(&mut con).unwrap();pub fn arg<T>(&mut self, arg: T) -> &mut Cmdwhere
T: ToRedisArgs,
pub fn arg<T>(&mut self, arg: T) -> &mut Cmdwhere
T: ToRedisArgs,
Appends an argument to the command. The argument passed must
be a type that implements ToRedisArgs. Most primitive types as
well as vectors of primitive types implement it.
For instance all of the following are valid:
redis::cmd("SET").arg(&["my_key", "my_value"]);
redis::cmd("SET").arg("my_key").arg(42);
redis::cmd("SET").arg("my_key").arg(b"my_value");pub fn cursor_arg(&mut self, cursor: u64) -> &mut Cmd
pub fn cursor_arg(&mut self, cursor: u64) -> &mut Cmd
Works similar to arg but adds a cursor argument. This is always
an integer and also flips the command implementation to support a
different mode for the iterators where the iterator will ask for
another batch of items when the local data is exhausted.
let mut cmd = redis::cmd("SSCAN");
let mut iter : redis::Iter<isize> =
cmd.arg("my_set").cursor_arg(0).clone().iter(&mut con).unwrap();
for x in iter {
// do something with the item
}pub fn get_packed_command(&self) -> Vec<u8, Global>ⓘ
pub fn get_packed_command(&self) -> Vec<u8, Global>ⓘ
Returns the packed command as a byte vector.
pub fn in_scan_mode(&self) -> bool
pub fn in_scan_mode(&self) -> bool
Returns true if the command is in scan mode.
pub fn query<T>(&self, con: &mut dyn ConnectionLike) -> Result<T, RedisError>where
T: FromRedisValue,
pub fn query<T>(&self, con: &mut dyn ConnectionLike) -> Result<T, RedisError>where
T: FromRedisValue,
Sends the command as query to the connection and converts the result to the target redis value. This is the general way how you can retrieve data.
pub async fn query_async<C, T>(
&self,
con: &mut C
) -> impl Future<Output = Result<T, RedisError>>where
T: FromRedisValue,
C: ConnectionLike,
pub async fn query_async<C, T>(
&self,
con: &mut C
) -> impl Future<Output = Result<T, RedisError>>where
T: FromRedisValue,
C: ConnectionLike,
Async version of query.
pub fn iter<T>(
self,
con: &mut dyn ConnectionLike
) -> Result<Iter<'_, T>, RedisError>where
T: FromRedisValue,
pub fn iter<T>(
self,
con: &mut dyn ConnectionLike
) -> Result<Iter<'_, T>, RedisError>where
T: FromRedisValue,
Similar to query() but returns an iterator over the items of the
bulk result or iterator. In normal mode this is not in any way more
efficient than just querying into a Vec<T> as it’s internally
implemented as buffering into a vector. This however is useful when
cursor_arg was used in which case the iterator will query for more
items until the server side cursor is exhausted.
This is useful for commands such as SSCAN, SCAN and others.
One speciality of this function is that it will check if the response
looks like a cursor or not and always just looks at the payload.
This way you can use the function the same for responses in the
format of KEYS (just a list) as well as SSCAN (which returns a
tuple of cursor and list).
pub async fn iter_async<'a, T>(
self,
con: &'a mut (dyn ConnectionLike + Send + 'a)
) -> impl Future<Output = Result<AsyncIter<'a, T>, RedisError>>where
T: 'a + FromRedisValue,
pub async fn iter_async<'a, T>(
self,
con: &'a mut (dyn ConnectionLike + Send + 'a)
) -> impl Future<Output = Result<AsyncIter<'a, T>, RedisError>>where
T: 'a + FromRedisValue,
Similar to iter() but returns an AsyncIter over the items of the
bulk result or iterator. A futures::Stream
can be obtained by calling stream() on the AsyncIter. In normal mode this is not in any way more
efficient than just querying into a Vec<T> as it’s internally
implemented as buffering into a vector. This however is useful when
cursor_arg was used in which case the stream will query for more
items until the server side cursor is exhausted.
This is useful for commands such as SSCAN, SCAN and others in async contexts.
One speciality of this function is that it will check if the response
looks like a cursor or not and always just looks at the payload.
This way you can use the function the same for responses in the
format of KEYS (just a list) as well as SSCAN (which returns a
tuple of cursor and list).
pub fn execute(&self, con: &mut dyn ConnectionLike)
pub fn execute(&self, con: &mut dyn ConnectionLike)
This is a shortcut to query() that does not return a value and
will fail the task if the query fails because of an error. This is
mainly useful in examples and for simple commands like setting
keys.
This is equivalent to a call of query like this:
let _ : () = redis::cmd("PING").query(&mut con).unwrap();pub fn args_iter(
&self
) -> impl Iterator<Item = Arg<&[u8]>> + Clone + ExactSizeIterator
pub fn args_iter(
&self
) -> impl Iterator<Item = Arg<&[u8]>> + Clone + ExactSizeIterator
Returns an iterator over the arguments in this command (including the command name itself)
impl Cmd
impl Cmd
pub fn get<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn get<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
Get the value of a key. If key is a vec this becomes an MGET.
pub fn set<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the string value of a key.
pub fn set_multiple<K, V, 'a>(items: &'a [(K, V)]) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set_multiple<K, V, 'a>(items: &'a [(K, V)]) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets multiple keys to their values.
pub fn set_ex<K, V, 'a>(key: K, value: V, seconds: usize) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set_ex<K, V, 'a>(key: K, value: V, seconds: usize) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the value and expiration of a key.
pub fn pset_ex<K, V, 'a>(key: K, value: V, milliseconds: usize) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn pset_ex<K, V, 'a>(key: K, value: V, milliseconds: usize) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the value and expiration in milliseconds of a key.
pub fn set_nx<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set_nx<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the value of a key, only if the key does not exist
pub fn mset_nx<K, V, 'a>(items: &'a [(K, V)]) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn mset_nx<K, V, 'a>(items: &'a [(K, V)]) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets multiple keys to their values failing if at least one already exists.
pub fn getset<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn getset<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the string value of a key and return its old value.
pub fn getrange<K, 'a>(key: K, from: isize, to: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn getrange<K, 'a>(key: K, from: isize, to: isize) -> Cmdwhere
K: ToRedisArgs,
Get a range of bytes/substring from the value of a key. Negative values provide an offset from the end of the value.
pub fn setrange<K, V, 'a>(key: K, offset: isize, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn setrange<K, V, 'a>(key: K, offset: isize, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Overwrite the part of the value stored in key at the specified offset.
pub fn expire<K, 'a>(key: K, seconds: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn expire<K, 'a>(key: K, seconds: usize) -> Cmdwhere
K: ToRedisArgs,
Set a key’s time to live in seconds.
pub fn expire_at<K, 'a>(key: K, ts: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn expire_at<K, 'a>(key: K, ts: usize) -> Cmdwhere
K: ToRedisArgs,
Set the expiration for a key as a UNIX timestamp.
pub fn pexpire<K, 'a>(key: K, ms: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn pexpire<K, 'a>(key: K, ms: usize) -> Cmdwhere
K: ToRedisArgs,
Set a key’s time to live in milliseconds.
pub fn pexpire_at<K, 'a>(key: K, ts: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn pexpire_at<K, 'a>(key: K, ts: usize) -> Cmdwhere
K: ToRedisArgs,
Set the expiration for a key as a UNIX timestamp in milliseconds.
pub fn pttl<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn pttl<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
Get the expiration time of a key in milliseconds.
pub fn rename_nx<K, 'a>(key: K, new_key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn rename_nx<K, 'a>(key: K, new_key: K) -> Cmdwhere
K: ToRedisArgs,
Rename a key, only if the new key does not exist.
pub fn append<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn append<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Append a value to a key.
pub fn incr<K, V, 'a>(key: K, delta: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn incr<K, V, 'a>(key: K, delta: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Increment the numeric value of a key by the given amount. This
issues a INCRBY or INCRBYFLOAT depending on the type.
pub fn decr<K, V, 'a>(key: K, delta: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn decr<K, V, 'a>(key: K, delta: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Decrement the numeric value of a key by the given amount.
pub fn setbit<K, 'a>(key: K, offset: usize, value: bool) -> Cmdwhere
K: ToRedisArgs,
pub fn setbit<K, 'a>(key: K, offset: usize, value: bool) -> Cmdwhere
K: ToRedisArgs,
Sets or clears the bit at offset in the string value stored at key.
pub fn getbit<K, 'a>(key: K, offset: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn getbit<K, 'a>(key: K, offset: usize) -> Cmdwhere
K: ToRedisArgs,
Returns the bit value at offset in the string value stored at key.
pub fn bitcount_range<K, 'a>(key: K, start: usize, end: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn bitcount_range<K, 'a>(key: K, start: usize, end: usize) -> Cmdwhere
K: ToRedisArgs,
Count set bits in a string in a range.
pub fn bit_and<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn bit_and<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
Perform a bitwise AND between multiple keys (containing string values) and store the result in the destination key.
pub fn bit_or<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn bit_or<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
Perform a bitwise OR between multiple keys (containing string values) and store the result in the destination key.
pub fn bit_xor<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn bit_xor<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
Perform a bitwise XOR between multiple keys (containing string values) and store the result in the destination key.
pub fn bit_not<K, 'a>(dstkey: K, srckey: K) -> Cmdwhere
K: ToRedisArgs,
pub fn bit_not<K, 'a>(dstkey: K, srckey: K) -> Cmdwhere
K: ToRedisArgs,
Perform a bitwise NOT of the key (containing string values) and store the result in the destination key.
pub fn strlen<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn strlen<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
Get the length of the value stored in a key.
pub fn hget<K, F, 'a>(key: K, field: F) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
pub fn hget<K, F, 'a>(key: K, field: F) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
Gets a single (or multiple) fields from a hash.
pub fn hdel<K, F, 'a>(key: K, field: F) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
pub fn hdel<K, F, 'a>(key: K, field: F) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
Deletes a single (or multiple) fields from a hash.
pub fn hset<K, F, V, 'a>(key: K, field: F, value: V) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
V: ToRedisArgs,
pub fn hset<K, F, V, 'a>(key: K, field: F, value: V) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
V: ToRedisArgs,
Sets a single field in a hash.
pub fn hset_nx<K, F, V, 'a>(key: K, field: F, value: V) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
V: ToRedisArgs,
pub fn hset_nx<K, F, V, 'a>(key: K, field: F, value: V) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
V: ToRedisArgs,
Sets a single field in a hash if it does not exist.
pub fn hset_multiple<K, F, V, 'a>(key: K, items: &'a [(F, V)]) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
V: ToRedisArgs,
pub fn hset_multiple<K, F, V, 'a>(key: K, items: &'a [(F, V)]) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
V: ToRedisArgs,
Sets a multiple fields in a hash.
pub fn hincr<K, F, D, 'a>(key: K, field: F, delta: D) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
D: ToRedisArgs,
pub fn hincr<K, F, D, 'a>(key: K, field: F, delta: D) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
D: ToRedisArgs,
Increments a value.
pub fn hexists<K, F, 'a>(key: K, field: F) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
pub fn hexists<K, F, 'a>(key: K, field: F) -> Cmdwhere
K: ToRedisArgs,
F: ToRedisArgs,
Checks if a field in a hash exists.
pub fn blmove<K, 'a>(
srckey: K,
dstkey: K,
src_dir: Direction,
dst_dir: Direction,
timeout: usize
) -> Cmdwhere
K: ToRedisArgs,
pub fn blmove<K, 'a>(
srckey: K,
dstkey: K,
src_dir: Direction,
dst_dir: Direction,
timeout: usize
) -> Cmdwhere
K: ToRedisArgs,
Pop an element from a list, push it to another list and return it; or block until one is available
pub fn blmpop<K, 'a>(
timeout: usize,
numkeys: usize,
key: K,
dir: Direction,
count: usize
) -> Cmdwhere
K: ToRedisArgs,
pub fn blmpop<K, 'a>(
timeout: usize,
numkeys: usize,
key: K,
dir: Direction,
count: usize
) -> Cmdwhere
K: ToRedisArgs,
Pops count elements from the first non-empty list key from the list of
provided key names; or blocks until one is available.
pub fn blpop<K, 'a>(key: K, timeout: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn blpop<K, 'a>(key: K, timeout: usize) -> Cmdwhere
K: ToRedisArgs,
Remove and get the first element in a list, or block until one is available.
pub fn brpop<K, 'a>(key: K, timeout: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn brpop<K, 'a>(key: K, timeout: usize) -> Cmdwhere
K: ToRedisArgs,
Remove and get the last element in a list, or block until one is available.
pub fn brpoplpush<K, 'a>(srckey: K, dstkey: K, timeout: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn brpoplpush<K, 'a>(srckey: K, dstkey: K, timeout: usize) -> Cmdwhere
K: ToRedisArgs,
Pop a value from a list, push it to another list and return it; or block until one is available.
pub fn lindex<K, 'a>(key: K, index: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn lindex<K, 'a>(key: K, index: isize) -> Cmdwhere
K: ToRedisArgs,
Get an element from a list by its index.
pub fn linsert_before<K, P, V, 'a>(key: K, pivot: P, value: V) -> Cmdwhere
K: ToRedisArgs,
P: ToRedisArgs,
V: ToRedisArgs,
pub fn linsert_before<K, P, V, 'a>(key: K, pivot: P, value: V) -> Cmdwhere
K: ToRedisArgs,
P: ToRedisArgs,
V: ToRedisArgs,
Insert an element before another element in a list.
pub fn linsert_after<K, P, V, 'a>(key: K, pivot: P, value: V) -> Cmdwhere
K: ToRedisArgs,
P: ToRedisArgs,
V: ToRedisArgs,
pub fn linsert_after<K, P, V, 'a>(key: K, pivot: P, value: V) -> Cmdwhere
K: ToRedisArgs,
P: ToRedisArgs,
V: ToRedisArgs,
Insert an element after another element in a list.
pub fn lmove<K, 'a>(
srckey: K,
dstkey: K,
src_dir: Direction,
dst_dir: Direction
) -> Cmdwhere
K: ToRedisArgs,
pub fn lmove<K, 'a>(
srckey: K,
dstkey: K,
src_dir: Direction,
dst_dir: Direction
) -> Cmdwhere
K: ToRedisArgs,
Pop an element a list, push it to another list and return it
pub fn lmpop<K, 'a>(numkeys: usize, key: K, dir: Direction, count: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn lmpop<K, 'a>(numkeys: usize, key: K, dir: Direction, count: usize) -> Cmdwhere
K: ToRedisArgs,
Pops count elements from the first non-empty list key from the list of
provided key names.
pub fn lpop<K, 'a>(key: K, count: Option<NonZeroUsize>) -> Cmdwhere
K: ToRedisArgs,
pub fn lpop<K, 'a>(key: K, count: Option<NonZeroUsize>) -> Cmdwhere
K: ToRedisArgs,
Removes and returns the up to count first elements of the list stored at key.
If count is not specified, then defaults to first element.
pub fn lpos<K, V, 'a>(key: K, value: V, options: LposOptions) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lpos<K, V, 'a>(key: K, value: V, options: LposOptions) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Returns the index of the first matching value of the list stored at key.
pub fn lpush<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lpush<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Insert all the specified values at the head of the list stored at key.
pub fn lpush_exists<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lpush_exists<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Inserts a value at the head of the list stored at key, only if key already exists and holds a list.
pub fn lrange<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn lrange<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Returns the specified elements of the list stored at key.
pub fn lrem<K, V, 'a>(key: K, count: isize, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lrem<K, V, 'a>(key: K, count: isize, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Removes the first count occurrences of elements equal to value from the list stored at key.
pub fn ltrim<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn ltrim<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Trim an existing list so that it will contain only the specified range of elements specified.
pub fn lset<K, V, 'a>(key: K, index: isize, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lset<K, V, 'a>(key: K, index: isize, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets the list element at index to value
pub fn rpop<K, 'a>(key: K, count: Option<NonZeroUsize>) -> Cmdwhere
K: ToRedisArgs,
pub fn rpop<K, 'a>(key: K, count: Option<NonZeroUsize>) -> Cmdwhere
K: ToRedisArgs,
Removes and returns the up to count last elements of the list stored at key
If count is not specified, then defaults to last element.
pub fn rpoplpush<K, 'a>(key: K, dstkey: K) -> Cmdwhere
K: ToRedisArgs,
pub fn rpoplpush<K, 'a>(key: K, dstkey: K) -> Cmdwhere
K: ToRedisArgs,
Pop a value from a list, push it to another list and return it.
pub fn rpush<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn rpush<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Insert all the specified values at the tail of the list stored at key.
pub fn rpush_exists<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn rpush_exists<K, V, 'a>(key: K, value: V) -> Cmdwhere
K: ToRedisArgs,
V: ToRedisArgs,
Inserts value at the tail of the list stored at key, only if key already exists and holds a list.
pub fn sadd<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn sadd<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Add one or more members to a set.
pub fn sdiffstore<K, 'a>(dstkey: K, keys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn sdiffstore<K, 'a>(dstkey: K, keys: K) -> Cmdwhere
K: ToRedisArgs,
Subtract multiple sets and store the resulting set in a key.
pub fn sinterstore<K, 'a>(dstkey: K, keys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn sinterstore<K, 'a>(dstkey: K, keys: K) -> Cmdwhere
K: ToRedisArgs,
Intersect multiple sets and store the resulting set in a key.
pub fn sismember<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn sismember<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine if a given value is a member of a set.
pub fn smove<K, M, 'a>(srckey: K, dstkey: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn smove<K, M, 'a>(srckey: K, dstkey: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Move a member from one set to another.
pub fn srandmember<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn srandmember<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
Get one random member from a set.
pub fn srandmember_multiple<K, 'a>(key: K, count: usize) -> Cmdwhere
K: ToRedisArgs,
pub fn srandmember_multiple<K, 'a>(key: K, count: usize) -> Cmdwhere
K: ToRedisArgs,
Get multiple random members from a set.
pub fn srem<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn srem<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Remove one or more members from a set.
pub fn sunionstore<K, 'a>(dstkey: K, keys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn sunionstore<K, 'a>(dstkey: K, keys: K) -> Cmdwhere
K: ToRedisArgs,
Add multiple sets and store the resulting set in a key.
pub fn zadd<K, S, M, 'a>(key: K, member: M, score: S) -> Cmdwhere
K: ToRedisArgs,
S: ToRedisArgs,
M: ToRedisArgs,
pub fn zadd<K, S, M, 'a>(key: K, member: M, score: S) -> Cmdwhere
K: ToRedisArgs,
S: ToRedisArgs,
M: ToRedisArgs,
Add one member to a sorted set, or update its score if it already exists.
pub fn zadd_multiple<K, S, M, 'a>(key: K, items: &'a [(S, M)]) -> Cmdwhere
K: ToRedisArgs,
S: ToRedisArgs,
M: ToRedisArgs,
pub fn zadd_multiple<K, S, M, 'a>(key: K, items: &'a [(S, M)]) -> Cmdwhere
K: ToRedisArgs,
S: ToRedisArgs,
M: ToRedisArgs,
Add multiple members to a sorted set, or update its score if it already exists.
pub fn zcount<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zcount<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Count the members in a sorted set with scores within the given values.
pub fn zincr<K, M, D, 'a>(key: K, member: M, delta: D) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
D: ToRedisArgs,
pub fn zincr<K, M, D, 'a>(key: K, member: M, delta: D) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
D: ToRedisArgs,
Increments the member in a sorted set at key by delta. If the member does not exist, it is added with delta as its score.
pub fn zinterstore<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
pub fn zinterstore<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
Intersect multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function.
pub fn zinterstore_min<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
pub fn zinterstore_min<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
Intersect multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function.
pub fn zinterstore_max<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
pub fn zinterstore_max<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
Intersect multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function.
pub fn zlexcount<K, L, 'a>(key: K, min: L, max: L) -> Cmdwhere
K: ToRedisArgs,
L: ToRedisArgs,
pub fn zlexcount<K, L, 'a>(key: K, min: L, max: L) -> Cmdwhere
K: ToRedisArgs,
L: ToRedisArgs,
Count the number of members in a sorted set between a given lexicographical range.
pub fn zpopmax<K, 'a>(key: K, count: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zpopmax<K, 'a>(key: K, count: isize) -> Cmdwhere
K: ToRedisArgs,
Removes and returns up to count members with the highest scores in a sorted set
pub fn zpopmin<K, 'a>(key: K, count: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zpopmin<K, 'a>(key: K, count: isize) -> Cmdwhere
K: ToRedisArgs,
Removes and returns up to count members with the lowest scores in a sorted set
pub fn zrandmember<K, 'a>(key: K, count: Option<isize>) -> Cmdwhere
K: ToRedisArgs,
pub fn zrandmember<K, 'a>(key: K, count: Option<isize>) -> Cmdwhere
K: ToRedisArgs,
Return up to count random members in a sorted set (or 1 if count == None)
pub fn zrandmember_withscores<K, 'a>(key: K, count: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zrandmember_withscores<K, 'a>(key: K, count: isize) -> Cmdwhere
K: ToRedisArgs,
Return up to count random members in a sorted set with scores
pub fn zrange<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zrange<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index
pub fn zrange_withscores<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zrange_withscores<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index with scores.
pub fn zrangebylex<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrangebylex<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Return a range of members in a sorted set, by lexicographical range.
pub fn zrangebylex_limit<K, M, MM, 'a>(
key: K,
min: M,
max: MM,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrangebylex_limit<K, M, MM, 'a>(
key: K,
min: M,
max: MM,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Return a range of members in a sorted set, by lexicographical range with offset and limit.
pub fn zrevrangebylex<K, MM, M, 'a>(key: K, max: MM, min: M) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrangebylex<K, MM, M, 'a>(key: K, max: MM, min: M) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
Return a range of members in a sorted set, by lexicographical range.
pub fn zrevrangebylex_limit<K, MM, M, 'a>(
key: K,
max: MM,
min: M,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrangebylex_limit<K, MM, M, 'a>(
key: K,
max: MM,
min: M,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
Return a range of members in a sorted set, by lexicographical range with offset and limit.
pub fn zrangebyscore<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrangebyscore<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Return a range of members in a sorted set, by score.
pub fn zrangebyscore_withscores<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrangebyscore_withscores<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Return a range of members in a sorted set, by score with scores.
pub fn zrangebyscore_limit<K, M, MM, 'a>(
key: K,
min: M,
max: MM,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrangebyscore_limit<K, M, MM, 'a>(
key: K,
min: M,
max: MM,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Return a range of members in a sorted set, by score with limit.
pub fn zrangebyscore_limit_withscores<K, M, MM, 'a>(
key: K,
min: M,
max: MM,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrangebyscore_limit_withscores<K, M, MM, 'a>(
key: K,
min: M,
max: MM,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Return a range of members in a sorted set, by score with limit with scores.
pub fn zrank<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zrank<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine the index of a member in a sorted set.
pub fn zrem<K, M, 'a>(key: K, members: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zrem<K, M, 'a>(key: K, members: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Remove one or more members from a sorted set.
pub fn zrembylex<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrembylex<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Remove all members in a sorted set between the given lexicographical range.
pub fn zremrangebyrank<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zremrangebyrank<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Remove all members in a sorted set within the given indexes.
pub fn zrembyscore<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
pub fn zrembyscore<K, M, MM, 'a>(key: K, min: M, max: MM) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
MM: ToRedisArgs,
Remove all members in a sorted set within the given scores.
pub fn zrevrange<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zrevrange<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index, with scores ordered from high to low.
pub fn zrevrange_withscores<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
pub fn zrevrange_withscores<K, 'a>(key: K, start: isize, stop: isize) -> Cmdwhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index, with scores ordered from high to low.
pub fn zrevrangebyscore<K, MM, M, 'a>(key: K, max: MM, min: M) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrangebyscore<K, MM, M, 'a>(key: K, max: MM, min: M) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
Return a range of members in a sorted set, by score.
pub fn zrevrangebyscore_withscores<K, MM, M, 'a>(key: K, max: MM, min: M) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrangebyscore_withscores<K, MM, M, 'a>(key: K, max: MM, min: M) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
Return a range of members in a sorted set, by score with scores.
pub fn zrevrangebyscore_limit<K, MM, M, 'a>(
key: K,
max: MM,
min: M,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrangebyscore_limit<K, MM, M, 'a>(
key: K,
max: MM,
min: M,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
Return a range of members in a sorted set, by score with limit.
pub fn zrevrangebyscore_limit_withscores<K, MM, M, 'a>(
key: K,
max: MM,
min: M,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrangebyscore_limit_withscores<K, MM, M, 'a>(
key: K,
max: MM,
min: M,
offset: isize,
count: isize
) -> Cmdwhere
K: ToRedisArgs,
MM: ToRedisArgs,
M: ToRedisArgs,
Return a range of members in a sorted set, by score with limit with scores.
pub fn zrevrank<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrank<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine the index of a member in a sorted set, with scores ordered from high to low.
pub fn zscore<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zscore<K, M, 'a>(key: K, member: M) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Get the score associated with the given member in a sorted set.
pub fn zscore_multiple<K, M, 'a>(key: K, members: &'a [M]) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zscore_multiple<K, M, 'a>(key: K, members: &'a [M]) -> Cmdwhere
K: ToRedisArgs,
M: ToRedisArgs,
Get the scores associated with multiple members in a sorted set.
pub fn zunionstore<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
pub fn zunionstore<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
Unions multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function.
pub fn zunionstore_min<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
pub fn zunionstore_min<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
Unions multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function.
pub fn zunionstore_max<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
pub fn zunionstore_max<K, 'a>(dstkey: K, keys: &'a [K]) -> Cmdwhere
K: ToRedisArgs,
Unions multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function.
pub fn pfadd<K, E, 'a>(key: K, element: E) -> Cmdwhere
K: ToRedisArgs,
E: ToRedisArgs,
pub fn pfadd<K, E, 'a>(key: K, element: E) -> Cmdwhere
K: ToRedisArgs,
E: ToRedisArgs,
Adds the specified elements to the specified HyperLogLog.
pub fn pfcount<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn pfcount<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
pub fn pfmerge<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
pub fn pfmerge<K, 'a>(dstkey: K, srckeys: K) -> Cmdwhere
K: ToRedisArgs,
Merge N different HyperLogLogs into a single one.
pub fn publish<K, E, 'a>(channel: K, message: E) -> Cmdwhere
K: ToRedisArgs,
E: ToRedisArgs,
pub fn publish<K, E, 'a>(channel: K, message: E) -> Cmdwhere
K: ToRedisArgs,
E: ToRedisArgs,
Posts a message to the given channel.
pub fn xrevrange_all<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
pub fn xrevrange_all<K, 'a>(key: K) -> Cmdwhere
K: ToRedisArgs,
This is the reverse version of xrange_all.
The same rules apply for start and end here.
XREVRANGE key + -