pub struct Pipeline { /* private fields */ }
Expand description
Represents a redis command pipeline.
Implementations§
Source§impl Pipeline
A pipeline allows you to send multiple commands in one go to the
redis server. API wise it’s very similar to just using a command
but it allows multiple commands to be chained and some features such
as iteration are not available.
impl Pipeline
A pipeline allows you to send multiple commands in one go to the redis server. API wise it’s very similar to just using a command but it allows multiple commands to be chained and some features such as iteration are not available.
Basic example:
let ((k1, k2),) : ((i32, i32),) = redis::pipe()
.cmd("SET").arg("key_1").arg(42).ignore()
.cmd("SET").arg("key_2").arg(43).ignore()
.cmd("MGET").arg(&["key_1", "key_2"]).query(&mut con).unwrap();
As you can see with cmd
you can start a new command. By default
each command produces a value but for some you can ignore them by
calling ignore
on the command. That way it will be skipped in the
return value which is useful for SET
commands and others, which
do not have a useful return value.
Sourcepub fn new() -> Pipeline
pub fn new() -> Pipeline
Creates an empty pipeline. For consistency with the cmd
api a pipe
function is provided as alias.
Sourcepub fn with_capacity(capacity: usize) -> Pipeline
pub fn with_capacity(capacity: usize) -> Pipeline
Creates an empty pipeline with pre-allocated capacity.
Sourcepub fn atomic(&mut self) -> &mut Pipeline
pub fn atomic(&mut self) -> &mut Pipeline
This enables atomic mode. In atomic mode the whole pipeline is
enclosed in MULTI
/EXEC
. From the user’s point of view nothing
changes however. This is easier than using MULTI
/EXEC
yourself
as the format does not change.
let (k1, k2) : (i32, i32) = redis::pipe()
.atomic()
.cmd("GET").arg("key_1")
.cmd("GET").arg("key_2").query(&mut con).unwrap();
Sourcepub fn get_packed_pipeline(&self) -> Vec<u8> ⓘ
pub fn get_packed_pipeline(&self) -> Vec<u8> ⓘ
Returns the encoded pipeline commands.
Sourcepub 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,
Executes the pipeline and fetches the return values. Since most pipelines return different types it’s recommended to use tuple matching to process the results:
let (k1, k2) : (i32, i32) = redis::pipe()
.cmd("SET").arg("key_1").arg(42).ignore()
.cmd("SET").arg("key_2").arg(43).ignore()
.cmd("GET").arg("key_1")
.cmd("GET").arg("key_2").query(&mut con).unwrap();
NOTE: A Pipeline object may be reused after query()
with all the commands as were inserted
to them. In order to clear a Pipeline object with minimal memory released/allocated,
it is necessary to call the clear()
before inserting new commands.
Sourcepub async fn query_async<C, T>(&self, con: &mut C) -> Result<T, RedisError>where
T: FromRedisValue,
C: ConnectionLike,
pub async fn query_async<C, T>(&self, con: &mut C) -> Result<T, RedisError>where
T: FromRedisValue,
C: ConnectionLike,
Async version of query
.
Sourcepub 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 of the pipeline fails.
This is equivalent to a call of query like this:
let _ : () = redis::pipe().cmd("PING").query(&mut con).unwrap();
NOTE: A Pipeline object may be reused after query()
with all the commands as were inserted
to them. In order to clear a Pipeline object with minimal memory released/allocated,
it is necessary to call the clear()
before inserting new commands.
Source§impl Pipeline
impl Pipeline
Sourcepub fn add_command(&mut self, cmd: Cmd) -> &mut Pipeline
pub fn add_command(&mut self, cmd: Cmd) -> &mut Pipeline
Adds a command to the cluster pipeline.
Sourcepub fn cmd(&mut self, name: &str) -> &mut Pipeline
pub fn cmd(&mut self, name: &str) -> &mut Pipeline
Starts a new command. Functions such as arg
then become
available to add more arguments to that command.
Sourcepub fn cmd_iter(&self) -> impl Iterator<Item = &Cmd>
pub fn cmd_iter(&self) -> impl Iterator<Item = &Cmd>
Returns an iterator over all the commands currently in this pipeline
Sourcepub fn ignore(&mut self) -> &mut Pipeline
pub fn ignore(&mut self) -> &mut Pipeline
Instructs the pipeline to ignore the return value of this command. It will still be ensured that it is not an error, but any successful result is just thrown away. This makes result processing through tuples much easier because you do not need to handle all the items you do not care about.
Sourcepub fn arg<T>(&mut self, arg: T) -> &mut Pipelinewhere
T: ToRedisArgs,
pub fn arg<T>(&mut self, arg: T) -> &mut Pipelinewhere
T: ToRedisArgs,
Adds an argument to the last started command. This works similar
to the arg
method of the Cmd
object.
Note that this function fails the task if executed on an empty pipeline.
Source§impl Pipeline
Implements common redis commands for pipelines. Unlike the regular
commands trait, this returns the pipeline rather than a result
directly. Other than that it works the same however.
impl Pipeline
Implements common redis commands for pipelines. Unlike the regular commands trait, this returns the pipeline rather than a result directly. Other than that it works the same however.
Sourcepub fn get<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn get<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the value of a key. If key is a vec this becomes an MGET
.
Sourcepub fn mget<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn mget<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get values of keys
Sourcepub fn keys<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn keys<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Gets all keys matching pattern
Sourcepub fn set<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the string value of a key.
Sourcepub fn set_options<'a, K, V>(
&mut self,
key: K,
value: V,
options: SetOptions,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set_options<'a, K, V>(
&mut self,
key: K,
value: V,
options: SetOptions,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the string value of a key with options.
Sourcepub fn set_multiple<'a, K, V>(&mut self, items: &'a [(K, V)]) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
👎Deprecated since 0.22.4: Renamed to mset() to reflect Redis name
pub fn set_multiple<'a, K, V>(&mut self, items: &'a [(K, V)]) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets multiple keys to their values.
Sourcepub fn mset<'a, K, V>(&mut self, items: &'a [(K, V)]) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn mset<'a, K, V>(&mut self, items: &'a [(K, V)]) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets multiple keys to their values.
Sourcepub fn set_ex<'a, K, V>(
&mut self,
key: K,
value: V,
seconds: u64,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set_ex<'a, K, V>(
&mut self,
key: K,
value: V,
seconds: u64,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the value and expiration of a key.
Sourcepub fn pset_ex<'a, K, V>(
&mut self,
key: K,
value: V,
milliseconds: u64,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn pset_ex<'a, K, V>(
&mut self,
key: K,
value: V,
milliseconds: u64,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the value and expiration in milliseconds of a key.
Sourcepub fn set_nx<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn set_nx<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the value of a key, only if the key does not exist
Sourcepub fn mset_nx<'a, K, V>(&mut self, items: &'a [(K, V)]) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn mset_nx<'a, K, V>(&mut self, items: &'a [(K, V)]) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets multiple keys to their values failing if at least one already exists.
Sourcepub fn getset<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn getset<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Set the string value of a key and return its old value.
Sourcepub fn getrange<'a, K>(
&mut self,
key: K,
from: isize,
to: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn getrange<'a, K>(
&mut self,
key: K,
from: isize,
to: isize,
) -> &mut Pipelinewhere
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.
Sourcepub fn setrange<'a, K, V>(
&mut self,
key: K,
offset: isize,
value: V,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn setrange<'a, K, V>(
&mut self,
key: K,
offset: isize,
value: V,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Overwrite the part of the value stored in key at the specified offset.
Sourcepub fn del<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn del<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Delete one or more keys.
Sourcepub fn exists<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn exists<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Determine if a key exists.
Sourcepub fn key_type<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn key_type<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Determine the type of a key.
Sourcepub fn expire<'a, K>(&mut self, key: K, seconds: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn expire<'a, K>(&mut self, key: K, seconds: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
Set a key’s time to live in seconds.
Sourcepub fn expire_at<'a, K>(&mut self, key: K, ts: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn expire_at<'a, K>(&mut self, key: K, ts: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
Set the expiration for a key as a UNIX timestamp.
Sourcepub fn pexpire<'a, K>(&mut self, key: K, ms: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn pexpire<'a, K>(&mut self, key: K, ms: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
Set a key’s time to live in milliseconds.
Sourcepub fn pexpire_at<'a, K>(&mut self, key: K, ts: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn pexpire_at<'a, K>(&mut self, key: K, ts: i64) -> &mut Pipelinewhere
K: ToRedisArgs,
Set the expiration for a key as a UNIX timestamp in milliseconds.
Sourcepub fn persist<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn persist<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Remove the expiration from a key.
Sourcepub fn ttl<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn ttl<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the expiration time of a key.
Sourcepub fn pttl<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn pttl<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the expiration time of a key in milliseconds.
Sourcepub fn get_ex<'a, K>(&mut self, key: K, expire_at: Expiry) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn get_ex<'a, K>(&mut self, key: K, expire_at: Expiry) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the value of a key and set expiration
Sourcepub fn get_del<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn get_del<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the value of a key and delete it
Sourcepub fn rename<'a, K, N>(&mut self, key: K, new_key: N) -> &mut Pipelinewhere
K: ToRedisArgs,
N: ToRedisArgs,
pub fn rename<'a, K, N>(&mut self, key: K, new_key: N) -> &mut Pipelinewhere
K: ToRedisArgs,
N: ToRedisArgs,
Rename a key.
Sourcepub fn rename_nx<'a, K, N>(&mut self, key: K, new_key: N) -> &mut Pipelinewhere
K: ToRedisArgs,
N: ToRedisArgs,
pub fn rename_nx<'a, K, N>(&mut self, key: K, new_key: N) -> &mut Pipelinewhere
K: ToRedisArgs,
N: ToRedisArgs,
Rename a key, only if the new key does not exist.
Sourcepub fn unlink<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn unlink<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Unlink one or more keys.
Sourcepub fn append<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn append<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Append a value to a key.
Sourcepub fn incr<'a, K, V>(&mut self, key: K, delta: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn incr<'a, K, V>(&mut self, key: K, delta: V) -> &mut Pipelinewhere
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.
Sourcepub fn decr<'a, K, V>(&mut self, key: K, delta: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn decr<'a, K, V>(&mut self, key: K, delta: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Decrement the numeric value of a key by the given amount.
Sourcepub fn setbit<'a, K>(
&mut self,
key: K,
offset: usize,
value: bool,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn setbit<'a, K>(
&mut self,
key: K,
offset: usize,
value: bool,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Sets or clears the bit at offset in the string value stored at key.
Sourcepub fn getbit<'a, K>(&mut self, key: K, offset: usize) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn getbit<'a, K>(&mut self, key: K, offset: usize) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the bit value at offset in the string value stored at key.
Sourcepub fn bitcount<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn bitcount<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Count set bits in a string.
Sourcepub fn bitcount_range<'a, K>(
&mut self,
key: K,
start: usize,
end: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn bitcount_range<'a, K>(
&mut self,
key: K,
start: usize,
end: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Count set bits in a string in a range.
Sourcepub fn bit_and<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
pub fn bit_and<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
Perform a bitwise AND between multiple keys (containing string values) and store the result in the destination key.
Sourcepub fn bit_or<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
pub fn bit_or<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
Perform a bitwise OR between multiple keys (containing string values) and store the result in the destination key.
Sourcepub fn bit_xor<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
pub fn bit_xor<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
Perform a bitwise XOR between multiple keys (containing string values) and store the result in the destination key.
Sourcepub fn bit_not<'a, D, S>(&mut self, dstkey: D, srckey: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
pub fn bit_not<'a, D, S>(&mut self, dstkey: D, srckey: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
Perform a bitwise NOT of the key (containing string values) and store the result in the destination key.
Sourcepub fn strlen<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn strlen<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the length of the value stored in a key.
Sourcepub fn hget<'a, K, F>(&mut self, key: K, field: F) -> &mut Pipelinewhere
K: ToRedisArgs,
F: ToRedisArgs,
pub fn hget<'a, K, F>(&mut self, key: K, field: F) -> &mut Pipelinewhere
K: ToRedisArgs,
F: ToRedisArgs,
Gets a single (or multiple) fields from a hash.
Sourcepub fn hdel<'a, K, F>(&mut self, key: K, field: F) -> &mut Pipelinewhere
K: ToRedisArgs,
F: ToRedisArgs,
pub fn hdel<'a, K, F>(&mut self, key: K, field: F) -> &mut Pipelinewhere
K: ToRedisArgs,
F: ToRedisArgs,
Deletes a single (or multiple) fields from a hash.
Sourcepub fn hset<'a, K, F, V>(&mut self, key: K, field: F, value: V) -> &mut Pipeline
pub fn hset<'a, K, F, V>(&mut self, key: K, field: F, value: V) -> &mut Pipeline
Sets a single field in a hash.
Sourcepub fn hset_nx<'a, K, F, V>(
&mut self,
key: K,
field: F,
value: V,
) -> &mut Pipeline
pub fn hset_nx<'a, K, F, V>( &mut self, key: K, field: F, value: V, ) -> &mut Pipeline
Sets a single field in a hash if it does not exist.
Sourcepub fn hset_multiple<'a, K, F, V>(
&mut self,
key: K,
items: &'a [(F, V)],
) -> &mut Pipeline
pub fn hset_multiple<'a, K, F, V>( &mut self, key: K, items: &'a [(F, V)], ) -> &mut Pipeline
Sets a multiple fields in a hash.
Sourcepub fn hincr<'a, K, F, D>(
&mut self,
key: K,
field: F,
delta: D,
) -> &mut Pipeline
pub fn hincr<'a, K, F, D>( &mut self, key: K, field: F, delta: D, ) -> &mut Pipeline
Increments a value.
Sourcepub fn hexists<'a, K, F>(&mut self, key: K, field: F) -> &mut Pipelinewhere
K: ToRedisArgs,
F: ToRedisArgs,
pub fn hexists<'a, K, F>(&mut self, key: K, field: F) -> &mut Pipelinewhere
K: ToRedisArgs,
F: ToRedisArgs,
Checks if a field in a hash exists.
Sourcepub fn hkeys<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn hkeys<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Gets all the keys in a hash.
Sourcepub fn hvals<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn hvals<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Gets all the values in a hash.
Sourcepub fn hgetall<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn hgetall<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Gets all the fields and values in a hash.
Sourcepub fn hlen<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn hlen<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Gets the length of a hash.
Sourcepub fn blmove<'a, S, D>(
&mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
timeout: f64,
) -> &mut Pipelinewhere
S: ToRedisArgs,
D: ToRedisArgs,
pub fn blmove<'a, S, D>(
&mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
timeout: f64,
) -> &mut Pipelinewhere
S: ToRedisArgs,
D: ToRedisArgs,
Pop an element from a list, push it to another list and return it; or block until one is available
Sourcepub fn blmpop<'a, K>(
&mut self,
timeout: f64,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn blmpop<'a, K>(
&mut self,
timeout: f64,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> &mut Pipelinewhere
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.
Sourcepub fn blpop<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn blpop<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
Remove and get the first element in a list, or block until one is available.
Sourcepub fn brpop<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn brpop<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
Remove and get the last element in a list, or block until one is available.
Sourcepub fn brpoplpush<'a, S, D>(
&mut self,
srckey: S,
dstkey: D,
timeout: f64,
) -> &mut Pipelinewhere
S: ToRedisArgs,
D: ToRedisArgs,
pub fn brpoplpush<'a, S, D>(
&mut self,
srckey: S,
dstkey: D,
timeout: f64,
) -> &mut Pipelinewhere
S: ToRedisArgs,
D: ToRedisArgs,
Pop a value from a list, push it to another list and return it; or block until one is available.
Sourcepub fn lindex<'a, K>(&mut self, key: K, index: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn lindex<'a, K>(&mut self, key: K, index: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
Get an element from a list by its index.
Sourcepub fn linsert_before<'a, K, P, V>(
&mut self,
key: K,
pivot: P,
value: V,
) -> &mut Pipeline
pub fn linsert_before<'a, K, P, V>( &mut self, key: K, pivot: P, value: V, ) -> &mut Pipeline
Insert an element before another element in a list.
Sourcepub fn linsert_after<'a, K, P, V>(
&mut self,
key: K,
pivot: P,
value: V,
) -> &mut Pipeline
pub fn linsert_after<'a, K, P, V>( &mut self, key: K, pivot: P, value: V, ) -> &mut Pipeline
Insert an element after another element in a list.
Sourcepub fn llen<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn llen<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the length of the list stored at key.
Sourcepub fn lmove<'a, S, D>(
&mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
) -> &mut Pipelinewhere
S: ToRedisArgs,
D: ToRedisArgs,
pub fn lmove<'a, S, D>(
&mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
) -> &mut Pipelinewhere
S: ToRedisArgs,
D: ToRedisArgs,
Pop an element a list, push it to another list and return it
Sourcepub fn lmpop<'a, K>(
&mut self,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn lmpop<'a, K>(
&mut self,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Pops count
elements from the first non-empty list key from the list of
provided key names.
Sourcepub fn lpop<'a, K>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn lpop<'a, K>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> &mut Pipelinewhere
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.
Sourcepub fn lpos<'a, K, V>(
&mut self,
key: K,
value: V,
options: LposOptions,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lpos<'a, K, V>(
&mut self,
key: K,
value: V,
options: LposOptions,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Returns the index of the first matching value of the list stored at key.
Sourcepub fn lpush<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lpush<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Insert all the specified values at the head of the list stored at key.
Sourcepub fn lpush_exists<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lpush_exists<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
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.
Sourcepub fn lrange<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn lrange<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the specified elements of the list stored at key.
Sourcepub fn lrem<'a, K, V>(
&mut self,
key: K,
count: isize,
value: V,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lrem<'a, K, V>(
&mut self,
key: K,
count: isize,
value: V,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Removes the first count occurrences of elements equal to value from the list stored at key.
Sourcepub fn ltrim<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn ltrim<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Trim an existing list so that it will contain only the specified range of elements specified.
Sourcepub fn lset<'a, K, V>(
&mut self,
key: K,
index: isize,
value: V,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn lset<'a, K, V>(
&mut self,
key: K,
index: isize,
value: V,
) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Sets the list element at index to value
Sourcepub fn rpop<'a, K>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn rpop<'a, K>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> &mut Pipelinewhere
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.
Sourcepub fn rpoplpush<'a, K, D>(&mut self, key: K, dstkey: D) -> &mut Pipelinewhere
K: ToRedisArgs,
D: ToRedisArgs,
pub fn rpoplpush<'a, K, D>(&mut self, key: K, dstkey: D) -> &mut Pipelinewhere
K: ToRedisArgs,
D: ToRedisArgs,
Pop a value from a list, push it to another list and return it.
Sourcepub fn rpush<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn rpush<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Insert all the specified values at the tail of the list stored at key.
Sourcepub fn rpush_exists<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
pub fn rpush_exists<'a, K, V>(&mut self, key: K, value: V) -> &mut Pipelinewhere
K: ToRedisArgs,
V: ToRedisArgs,
Inserts value at the tail of the list stored at key, only if key already exists and holds a list.
Sourcepub fn sadd<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn sadd<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Add one or more members to a set.
Sourcepub fn scard<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn scard<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the number of members in a set.
Sourcepub fn sdiff<'a, K>(&mut self, keys: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn sdiff<'a, K>(&mut self, keys: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Subtract multiple sets.
Sourcepub fn sdiffstore<'a, D, K>(&mut self, dstkey: D, keys: K) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn sdiffstore<'a, D, K>(&mut self, dstkey: D, keys: K) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Subtract multiple sets and store the resulting set in a key.
Sourcepub fn sinter<'a, K>(&mut self, keys: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn sinter<'a, K>(&mut self, keys: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Intersect multiple sets.
Sourcepub fn sinterstore<'a, D, K>(&mut self, dstkey: D, keys: K) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn sinterstore<'a, D, K>(&mut self, dstkey: D, keys: K) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Intersect multiple sets and store the resulting set in a key.
Sourcepub fn sismember<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn sismember<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine if a given value is a member of a set.
Sourcepub fn smismember<'a, K, M>(&mut self, key: K, members: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn smismember<'a, K, M>(&mut self, key: K, members: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine if given values are members of a set.
Sourcepub fn smembers<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn smembers<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get all the members in a set.
Sourcepub fn smove<'a, S, D, M>(
&mut self,
srckey: S,
dstkey: D,
member: M,
) -> &mut Pipeline
pub fn smove<'a, S, D, M>( &mut self, srckey: S, dstkey: D, member: M, ) -> &mut Pipeline
Move a member from one set to another.
Sourcepub fn spop<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn spop<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Remove and return a random member from a set.
Sourcepub fn srandmember<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn srandmember<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get one random member from a set.
Sourcepub fn srandmember_multiple<'a, K>(
&mut self,
key: K,
count: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn srandmember_multiple<'a, K>(
&mut self,
key: K,
count: usize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Get multiple random members from a set.
Sourcepub fn srem<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn srem<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Remove one or more members from a set.
Sourcepub fn sunion<'a, K>(&mut self, keys: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn sunion<'a, K>(&mut self, keys: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Add multiple sets.
Sourcepub fn sunionstore<'a, D, K>(&mut self, dstkey: D, keys: K) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn sunionstore<'a, D, K>(&mut self, dstkey: D, keys: K) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Add multiple sets and store the resulting set in a key.
Sourcepub fn zadd<'a, K, S, M>(
&mut self,
key: K,
member: M,
score: S,
) -> &mut Pipeline
pub fn zadd<'a, K, S, M>( &mut self, key: K, member: M, score: S, ) -> &mut Pipeline
Add one member to a sorted set, or update its score if it already exists.
Sourcepub fn zadd_multiple<'a, K, S, M>(
&mut self,
key: K,
items: &'a [(S, M)],
) -> &mut Pipeline
pub fn zadd_multiple<'a, K, S, M>( &mut self, key: K, items: &'a [(S, M)], ) -> &mut Pipeline
Add multiple members to a sorted set, or update its score if it already exists.
Sourcepub fn zcard<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zcard<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Get the number of members in a sorted set.
Sourcepub fn zcount<'a, K, M, MM>(&mut self, key: K, min: M, max: MM) -> &mut Pipeline
pub fn zcount<'a, K, M, MM>(&mut self, key: K, min: M, max: MM) -> &mut Pipeline
Count the members in a sorted set with scores within the given values.
Sourcepub fn zincr<'a, K, M, D>(
&mut self,
key: K,
member: M,
delta: D,
) -> &mut Pipeline
pub fn zincr<'a, K, M, D>( &mut self, key: K, member: M, delta: D, ) -> &mut Pipeline
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.
Sourcepub fn zinterstore<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn zinterstore<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Intersect multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function.
Sourcepub fn zinterstore_min<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn zinterstore_min<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Intersect multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function.
Sourcepub fn zinterstore_max<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn zinterstore_max<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Intersect multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function.
Sourcepub fn zinterstore_weights<'a, D, K, W>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> &mut Pipeline
pub fn zinterstore_weights<'a, D, K, W>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> &mut Pipeline
Commands::zinterstore
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Sourcepub fn zinterstore_min_weights<'a, D, K, W>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> &mut Pipeline
pub fn zinterstore_min_weights<'a, D, K, W>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> &mut Pipeline
Commands::zinterstore_min
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Sourcepub fn zinterstore_max_weights<'a, D, K, W>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> &mut Pipeline
pub fn zinterstore_max_weights<'a, D, K, W>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> &mut Pipeline
Commands::zinterstore_max
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Sourcepub fn zlexcount<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
) -> &mut Pipeline
pub fn zlexcount<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, ) -> &mut Pipeline
Count the number of members in a sorted set between a given lexicographical range.
Sourcepub fn bzpopmax<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn bzpopmax<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns the member with the highest score in a sorted set. Blocks until a member is available otherwise.
Sourcepub fn zpopmax<'a, K>(&mut self, key: K, count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zpopmax<'a, K>(&mut self, key: K, count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns up to count members with the highest scores in a sorted set
Sourcepub fn bzpopmin<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn bzpopmin<'a, K>(&mut self, key: K, timeout: f64) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns the member with the lowest score in a sorted set. Blocks until a member is available otherwise.
Sourcepub fn zpopmin<'a, K>(&mut self, key: K, count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zpopmin<'a, K>(&mut self, key: K, count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns up to count members with the lowest scores in a sorted set
Sourcepub fn bzmpop_max<'a, K>(
&mut self,
timeout: f64,
keys: &'a [K],
count: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn bzmpop_max<'a, K>(
&mut self,
timeout: f64,
keys: &'a [K],
count: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns up to count members with the highest scores, from the first non-empty sorted set in the provided list of key names. Blocks until a member is available otherwise.
Sourcepub fn zmpop_max<'a, K>(&mut self, keys: &'a [K], count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zmpop_max<'a, K>(&mut self, keys: &'a [K], count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns up to count members with the highest scores, from the first non-empty sorted set in the provided list of key names.
Sourcepub fn bzmpop_min<'a, K>(
&mut self,
timeout: f64,
keys: &'a [K],
count: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn bzmpop_min<'a, K>(
&mut self,
timeout: f64,
keys: &'a [K],
count: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns up to count members with the lowest scores, from the first non-empty sorted set in the provided list of key names. Blocks until a member is available otherwise.
Sourcepub fn zmpop_min<'a, K>(&mut self, keys: &'a [K], count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zmpop_min<'a, K>(&mut self, keys: &'a [K], count: isize) -> &mut Pipelinewhere
K: ToRedisArgs,
Removes and returns up to count members with the lowest scores, from the first non-empty sorted set in the provided list of key names.
Sourcepub fn zrandmember<'a, K>(
&mut self,
key: K,
count: Option<isize>,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zrandmember<'a, K>(
&mut self,
key: K,
count: Option<isize>,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Return up to count random members in a sorted set (or 1 if count == None
)
Sourcepub fn zrandmember_withscores<'a, K>(
&mut self,
key: K,
count: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zrandmember_withscores<'a, K>(
&mut self,
key: K,
count: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Return up to count random members in a sorted set with scores
Sourcepub fn zrange<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zrange<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index
Sourcepub fn zrange_withscores<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zrange_withscores<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index with scores.
Sourcepub fn zrangebylex<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
) -> &mut Pipeline
pub fn zrangebylex<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, ) -> &mut Pipeline
Return a range of members in a sorted set, by lexicographical range.
Sourcepub fn zrangebylex_limit<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> &mut Pipeline
pub fn zrangebylex_limit<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize, ) -> &mut Pipeline
Return a range of members in a sorted set, by lexicographical range with offset and limit.
Sourcepub fn zrevrangebylex<'a, K, MM, M>(
&mut self,
key: K,
max: MM,
min: M,
) -> &mut Pipeline
pub fn zrevrangebylex<'a, K, MM, M>( &mut self, key: K, max: MM, min: M, ) -> &mut Pipeline
Return a range of members in a sorted set, by lexicographical range.
Sourcepub fn zrevrangebylex_limit<'a, K, MM, M>(
&mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> &mut Pipeline
pub fn zrevrangebylex_limit<'a, K, MM, M>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize, ) -> &mut Pipeline
Return a range of members in a sorted set, by lexicographical range with offset and limit.
Sourcepub fn zrangebyscore<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
) -> &mut Pipeline
pub fn zrangebyscore<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, ) -> &mut Pipeline
Return a range of members in a sorted set, by score.
Sourcepub fn zrangebyscore_withscores<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
) -> &mut Pipeline
pub fn zrangebyscore_withscores<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, ) -> &mut Pipeline
Return a range of members in a sorted set, by score with scores.
Sourcepub fn zrangebyscore_limit<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> &mut Pipeline
pub fn zrangebyscore_limit<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize, ) -> &mut Pipeline
Return a range of members in a sorted set, by score with limit.
Sourcepub fn zrangebyscore_limit_withscores<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> &mut Pipeline
pub fn zrangebyscore_limit_withscores<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize, ) -> &mut Pipeline
Return a range of members in a sorted set, by score with limit with scores.
Sourcepub fn zrank<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zrank<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine the index of a member in a sorted set.
Sourcepub fn zrem<'a, K, M>(&mut self, key: K, members: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zrem<'a, K, M>(&mut self, key: K, members: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Remove one or more members from a sorted set.
Sourcepub fn zrembylex<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
) -> &mut Pipeline
pub fn zrembylex<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, ) -> &mut Pipeline
Remove all members in a sorted set between the given lexicographical range.
Sourcepub fn zremrangebyrank<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zremrangebyrank<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Remove all members in a sorted set within the given indexes.
Sourcepub fn zrembyscore<'a, K, M, MM>(
&mut self,
key: K,
min: M,
max: MM,
) -> &mut Pipeline
pub fn zrembyscore<'a, K, M, MM>( &mut self, key: K, min: M, max: MM, ) -> &mut Pipeline
Remove all members in a sorted set within the given scores.
Sourcepub fn zrevrange<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zrevrange<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index, with scores ordered from high to low.
Sourcepub fn zrevrange_withscores<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn zrevrange_withscores<'a, K>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> &mut Pipelinewhere
K: ToRedisArgs,
Return a range of members in a sorted set, by index, with scores ordered from high to low.
Sourcepub fn zrevrangebyscore<'a, K, MM, M>(
&mut self,
key: K,
max: MM,
min: M,
) -> &mut Pipeline
pub fn zrevrangebyscore<'a, K, MM, M>( &mut self, key: K, max: MM, min: M, ) -> &mut Pipeline
Return a range of members in a sorted set, by score.
Sourcepub fn zrevrangebyscore_withscores<'a, K, MM, M>(
&mut self,
key: K,
max: MM,
min: M,
) -> &mut Pipeline
pub fn zrevrangebyscore_withscores<'a, K, MM, M>( &mut self, key: K, max: MM, min: M, ) -> &mut Pipeline
Return a range of members in a sorted set, by score with scores.
Sourcepub fn zrevrangebyscore_limit<'a, K, MM, M>(
&mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> &mut Pipeline
pub fn zrevrangebyscore_limit<'a, K, MM, M>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize, ) -> &mut Pipeline
Return a range of members in a sorted set, by score with limit.
Sourcepub fn zrevrangebyscore_limit_withscores<'a, K, MM, M>(
&mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> &mut Pipeline
pub fn zrevrangebyscore_limit_withscores<'a, K, MM, M>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize, ) -> &mut Pipeline
Return a range of members in a sorted set, by score with limit with scores.
Sourcepub fn zrevrank<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zrevrank<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Determine the index of a member in a sorted set, with scores ordered from high to low.
Sourcepub fn zscore<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zscore<'a, K, M>(&mut self, key: K, member: M) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Get the score associated with the given member in a sorted set.
Sourcepub fn zscore_multiple<'a, K, M>(
&mut self,
key: K,
members: &'a [M],
) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
pub fn zscore_multiple<'a, K, M>(
&mut self,
key: K,
members: &'a [M],
) -> &mut Pipelinewhere
K: ToRedisArgs,
M: ToRedisArgs,
Get the scores associated with multiple members in a sorted set.
Sourcepub fn zunionstore<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn zunionstore<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Unions multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function.
Sourcepub fn zunionstore_min<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn zunionstore_min<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Unions multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function.
Sourcepub fn zunionstore_max<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
pub fn zunionstore_max<'a, D, K>(
&mut self,
dstkey: D,
keys: &'a [K],
) -> &mut Pipelinewhere
D: ToRedisArgs,
K: ToRedisArgs,
Unions multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function.
Sourcepub fn zunionstore_weights<'a, D, K, W>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> &mut Pipeline
pub fn zunionstore_weights<'a, D, K, W>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> &mut Pipeline
Commands::zunionstore
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Sourcepub fn zunionstore_min_weights<'a, D, K, W>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> &mut Pipeline
pub fn zunionstore_min_weights<'a, D, K, W>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> &mut Pipeline
Commands::zunionstore_min
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Sourcepub fn zunionstore_max_weights<'a, D, K, W>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> &mut Pipeline
pub fn zunionstore_max_weights<'a, D, K, W>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> &mut Pipeline
Commands::zunionstore_max
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Sourcepub fn pfadd<'a, K, E>(&mut self, key: K, element: E) -> &mut Pipelinewhere
K: ToRedisArgs,
E: ToRedisArgs,
pub fn pfadd<'a, K, E>(&mut self, key: K, element: E) -> &mut Pipelinewhere
K: ToRedisArgs,
E: ToRedisArgs,
Adds the specified elements to the specified HyperLogLog.
Sourcepub fn pfcount<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn pfcount<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
Sourcepub fn pfmerge<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
pub fn pfmerge<'a, D, S>(&mut self, dstkey: D, srckeys: S) -> &mut Pipelinewhere
D: ToRedisArgs,
S: ToRedisArgs,
Merge N different HyperLogLogs into a single one.
Sourcepub fn publish<'a, K, E>(&mut self, channel: K, message: E) -> &mut Pipelinewhere
K: ToRedisArgs,
E: ToRedisArgs,
pub fn publish<'a, K, E>(&mut self, channel: K, message: E) -> &mut Pipelinewhere
K: ToRedisArgs,
E: ToRedisArgs,
Posts a message to the given channel.
Sourcepub fn object_encoding<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn object_encoding<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the encoding of a key.
Sourcepub fn object_idletime<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn object_idletime<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the time in seconds since the last access of a key.
Sourcepub fn object_freq<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn object_freq<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the logarithmic access frequency counter of a key.
Sourcepub fn object_refcount<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn object_refcount<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
Returns the reference count of a key.
Sourcepub fn xrevrange_all<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
pub fn xrevrange_all<'a, K>(&mut self, key: K) -> &mut Pipelinewhere
K: ToRedisArgs,
This is the reverse version of xrange_all
.
The same rules apply for start
and end
here.
XREVRANGE key + -
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pipeline
impl RefUnwindSafe for Pipeline
impl Send for Pipeline
impl Sync for Pipeline
impl Unpin for Pipeline
impl UnwindSafe for Pipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);