Struct redis_driver::Transaction
source · [−]pub struct Transaction { /* private fields */ }
Implementations
Trait Implementations
sourceimpl BitmapCommands for Transaction
impl BitmapCommands for Transaction
sourcefn bitcount<K>(&self, key: K, range: Option<BitRange>) -> Future<'_, usize>where
K: Into<BulkString>,
fn bitcount<K>(&self, key: K, range: Option<BitRange>) -> Future<'_, usize>where
K: Into<BulkString>,
Count the number of set bits (population counting) in a string. Read more
sourcefn bitfield<K, C, E, O>(&self, key: K, sub_commands: C) -> Future<'_, Vec<u64>>where
K: Into<BulkString>,
E: Into<BulkString>,
O: Into<BulkString>,
C: ArgsOrCollection<BitFieldSubCommand<E, O>>,
fn bitfield<K, C, E, O>(&self, key: K, sub_commands: C) -> Future<'_, Vec<u64>>where
K: Into<BulkString>,
E: Into<BulkString>,
O: Into<BulkString>,
C: ArgsOrCollection<BitFieldSubCommand<E, O>>,
The command treats a Redis string as an array of bits, and is capable of addressing specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset. Read more
sourcefn bitfield_readonly<K, C, E, O>(
&self,
key: K,
get_commands: C
) -> Future<'_, Vec<u64>>where
K: Into<BulkString>,
E: Into<BulkString>,
O: Into<BulkString>,
C: ArgsOrCollection<BitFieldGetSubCommand<E, O>>,
fn bitfield_readonly<K, C, E, O>(
&self,
key: K,
get_commands: C
) -> Future<'_, Vec<u64>>where
K: Into<BulkString>,
E: Into<BulkString>,
O: Into<BulkString>,
C: ArgsOrCollection<BitFieldGetSubCommand<E, O>>,
Read-only variant of the BITFIELD command. It is like the original BITFIELD but only accepts GET subcommand and can safely be used in read-only replicas. Read more
sourcefn bitop<D, K, KK>(
&self,
operation: BitOperation,
dest_key: D,
keys: KK
) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
fn bitop<D, K, KK>(
&self,
operation: BitOperation,
dest_key: D,
keys: KK
) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. Read more
sourcefn bitpos<K>(&self, key: K, bit: u64, range: Option<BitRange>) -> Future<'_, usize>where
K: Into<BulkString>,
fn bitpos<K>(&self, key: K, bit: u64, range: Option<BitRange>) -> Future<'_, usize>where
K: Into<BulkString>,
Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. Read more
sourceimpl CommandSend for Transaction
impl CommandSend for Transaction
sourceimpl GenericCommands for Transaction
impl GenericCommands for Transaction
sourcefn copy<S, D>(
&self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool
) -> Future<'_, bool>where
S: Into<BulkString>,
D: Into<BulkString>,
fn copy<S, D>(
&self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool
) -> Future<'_, bool>where
S: Into<BulkString>,
D: Into<BulkString>,
This command copies the value stored at the source key to the destination key. Read more
sourcefn del<K, C>(&self, keys: C) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn del<K, C>(&self, keys: C) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
Removes the specified keys. A key is ignored if it does not exist. Read more
sourcefn dump<K>(&self, key: K) -> Future<'_, Vec<u8>>where
K: Into<BulkString>,
fn dump<K>(&self, key: K) -> Future<'_, Vec<u8>>where
K: Into<BulkString>,
Serialize the value stored at key in a Redis-specific format and return it to the user. Read more
sourcefn exists<K, C>(&self, keys: C) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn exists<K, C>(&self, keys: C) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
Returns if keys exist. Read more
sourcefn expire<K>(
&self,
key: K,
seconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
fn expire<K>(
&self,
key: K,
seconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
Set a timeout on key in seconds Read more
sourcefn expireat<K>(
&self,
key: K,
unix_time_seconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
fn expireat<K>(
&self,
key: K,
unix_time_seconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970) Read more
sourcefn expiretime<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn expiretime<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire. Read more
sourcefn keys<P, K, A>(&self, pattern: P) -> Future<'_, A>where
P: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K>,
fn keys<P, K, A>(&self, pattern: P) -> Future<'_, A>where
P: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K>,
Returns all keys matching pattern. Read more
sourcefn migrate<H, K, P1, U, P2, KK>(
&self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions<P1, U, P2, K, KK>
) -> Future<'_, bool>where
H: Into<BulkString>,
K: Into<BulkString>,
P1: Into<BulkString>,
U: Into<BulkString>,
P2: Into<BulkString>,
KK: SingleArgOrCollection<K>,
fn migrate<H, K, P1, U, P2, KK>(
&self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions<P1, U, P2, K, KK>
) -> Future<'_, bool>where
H: Into<BulkString>,
K: Into<BulkString>,
P1: Into<BulkString>,
U: Into<BulkString>,
P2: Into<BulkString>,
KK: SingleArgOrCollection<K>,
Atomically transfer a key or a collection of keys from a source Redis instance to a destination Redis instance. Read more
sourcefn move_<K>(&self, key: K, db: usize) -> Future<'_, i64>where
K: Into<BulkString>,
fn move_<K>(&self, key: K, db: usize) -> Future<'_, i64>where
K: Into<BulkString>,
Move key from the currently selected database to the specified destination database. Read more
sourcefn object_encoding<K, E>(&self, key: K) -> Future<'_, E>where
K: Into<BulkString>,
E: FromValue,
fn object_encoding<K, E>(&self, key: K) -> Future<'_, E>where
K: Into<BulkString>,
E: FromValue,
Returns the internal encoding for the Redis object stored at key
Read more
sourcefn object_freq<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn object_freq<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
This command returns the logarithmic access frequency counter of a Redis object stored at key
. Read more
sourcefn object_idle_time<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn object_idle_time<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
This command returns the time in seconds since the last access to the value stored at key
. Read more
sourcefn object_refcount<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn object_refcount<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
This command returns the reference count of the stored at key
. Read more
sourcefn persist<K>(&self, key: K) -> Future<'_, bool>where
K: Into<BulkString>,
fn persist<K>(&self, key: K) -> Future<'_, bool>where
K: Into<BulkString>,
Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated). Read more
sourcefn pexpire<K>(
&self,
key: K,
milliseconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
fn pexpire<K>(
&self,
key: K,
milliseconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds. Read more
sourcefn pexpireat<K>(
&self,
key: K,
unix_time_milliseconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
fn pexpireat<K>(
&self,
key: K,
unix_time_milliseconds: u64,
option: Option<ExpireOption>
) -> Future<'_, bool>where
K: Into<BulkString>,
PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds. Read more
sourcefn pexpiretime<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn pexpiretime<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
PEXPIRETIME has the same semantic as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds. Read more
sourcefn pttl<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn pttl<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
Returns the remaining time to live of a key that has a timeout. Read more
sourcefn randomkey<R>(&self) -> Future<'_, R>where
R: FromValue,
fn randomkey<R>(&self) -> Future<'_, R>where
R: FromValue,
Return a random key from the currently selected database. Read more
sourcefn rename<K1, K2>(&self, key: K1, new_key: K2) -> Future<'_, ()>where
K1: Into<BulkString>,
K2: Into<BulkString>,
fn rename<K1, K2>(&self, key: K1, new_key: K2) -> Future<'_, ()>where
K1: Into<BulkString>,
K2: Into<BulkString>,
Renames key to newkey. Read more
sourcefn renamenx<K1, K2>(&self, key: K1, new_key: K2) -> Future<'_, bool>where
K1: Into<BulkString>,
K2: Into<BulkString>,
fn renamenx<K1, K2>(&self, key: K1, new_key: K2) -> Future<'_, bool>where
K1: Into<BulkString>,
K2: Into<BulkString>,
Renames key to newkey if newkey does not yet exist. It returns an error when key does not exist. Read more
sourcefn restore<K>(
&self,
key: K,
ttl: u64,
serialized_value: Vec<u8>,
replace: bool,
abs_ttl: bool,
idle_time: Option<i64>,
frequency: Option<f64>
) -> Future<'_, ()>where
K: Into<BulkString>,
fn restore<K>(
&self,
key: K,
ttl: u64,
serialized_value: Vec<u8>,
replace: bool,
abs_ttl: bool,
idle_time: Option<i64>,
frequency: Option<f64>
) -> Future<'_, ()>where
K: Into<BulkString>,
Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP). Read more
sourcefn scan<P, T, K, A>(
&self,
cursor: u64,
match_pattern: Option<P>,
count: Option<usize>,
type_: Option<T>
) -> Future<'_, (u64, A)>where
P: Into<BulkString>,
T: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K> + Default,
fn scan<P, T, K, A>(
&self,
cursor: u64,
match_pattern: Option<P>,
count: Option<usize>,
type_: Option<T>
) -> Future<'_, (u64, A)>where
P: Into<BulkString>,
T: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K> + Default,
Iterates the set of keys in the currently selected Redis database. Read more
sourcefn sort<K, BP, GP, M, A>(
&self,
key: K,
options: SortOptions<BP, GP>
) -> Future<'_, A>where
K: Into<BulkString>,
BP: Into<BulkString>,
GP: Into<BulkString>,
M: FromValue,
A: FromSingleValueArray<M>,
fn sort<K, BP, GP, M, A>(
&self,
key: K,
options: SortOptions<BP, GP>
) -> Future<'_, A>where
K: Into<BulkString>,
BP: Into<BulkString>,
GP: Into<BulkString>,
M: FromValue,
A: FromSingleValueArray<M>,
Returns the elements contained in the list, set or sorted set at key. Read more
sourcefn sort_and_store<K, BP, GP, D>(
&self,
key: K,
destination: D,
options: SortOptions<BP, GP>
) -> Future<'_, usize>where
K: Into<BulkString>,
BP: Into<BulkString>,
GP: Into<BulkString>,
D: Into<BulkString>,
fn sort_and_store<K, BP, GP, D>(
&self,
key: K,
destination: D,
options: SortOptions<BP, GP>
) -> Future<'_, usize>where
K: Into<BulkString>,
BP: Into<BulkString>,
GP: Into<BulkString>,
D: Into<BulkString>,
Stores the elements contained in the list, set or sorted set at key. Read more
sourcefn sort_readonly<K, BP, GP, M, A>(
&self,
key: K,
options: SortOptions<BP, GP>
) -> Future<'_, A>where
K: Into<BulkString>,
BP: Into<BulkString>,
GP: Into<BulkString>,
M: FromValue,
A: FromSingleValueArray<M>,
fn sort_readonly<K, BP, GP, M, A>(
&self,
key: K,
options: SortOptions<BP, GP>
) -> Future<'_, A>where
K: Into<BulkString>,
BP: Into<BulkString>,
GP: Into<BulkString>,
M: FromValue,
A: FromSingleValueArray<M>,
Read-only variant of the SORT command. Read more
sourcefn touch<K, KK>(&self, keys: KK) -> Future<'_, usize>where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
fn touch<K, KK>(&self, keys: KK) -> Future<'_, usize>where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
Alters the last access time of a key(s). A key is ignored if it does not exist. Read more
sourcefn ttl<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn ttl<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
Returns the remaining time to live of a key that has a timeout. Read more
sourcefn type_<K>(&self, key: K) -> Future<'_, String>where
K: Into<BulkString>,
fn type_<K>(&self, key: K) -> Future<'_, String>where
K: Into<BulkString>,
Returns the string representation of the type of the value stored at key. Read more
sourcefn unlink<K, C>(&self, keys: C) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn unlink<K, C>(&self, keys: C) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
This command is very similar to DEL: it removes the specified keys. Read more
sourceimpl GeoCommands for Transaction
impl GeoCommands for Transaction
sourcefn geoadd<K, M, I>(
&self,
key: K,
condition: Option<GeoAddCondition>,
change: bool,
items: I
) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, f64, M)>,
fn geoadd<K, M, I>(
&self,
key: K,
condition: Option<GeoAddCondition>,
change: bool,
items: I
) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, f64, M)>,
Adds the specified geospatial items (longitude, latitude, name) to the specified key. Read more
sourcefn geodist<K, M>(
&self,
key: K,
member1: M,
member2: M,
unit: GeoUnit
) -> Future<'_, Option<f64>>where
K: Into<BulkString>,
M: Into<BulkString>,
fn geodist<K, M>(
&self,
key: K,
member1: M,
member2: M,
unit: GeoUnit
) -> Future<'_, Option<f64>>where
K: Into<BulkString>,
M: Into<BulkString>,
Return the distance between two members in the geospatial index represented by the sorted set. Read more
sourcefn geohash<K, M, C>(&self, key: K, members: C) -> Future<'_, Vec<String>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn geohash<K, M, C>(&self, key: K, members: C) -> Future<'_, Vec<String>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
sourcefn geopos<K, M, C>(
&self,
key: K,
members: C
) -> Future<'_, Vec<Option<(f64, f64)>>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn geopos<K, M, C>(
&self,
key: K,
members: C
) -> Future<'_, Vec<Option<(f64, f64)>>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key. Read more
sourcefn geosearch<K, M1, M2, A>(
&self,
key: K,
from: GeoSearchFrom<M1>,
by: GeoSearchBy,
order: Option<GeoSearchOrder>,
count: Option<(usize, bool)>
) -> Future<'_, A>where
K: Into<BulkString>,
M1: Into<BulkString>,
M2: FromValue,
A: FromSingleValueArray<M2>,
fn geosearch<K, M1, M2, A>(
&self,
key: K,
from: GeoSearchFrom<M1>,
by: GeoSearchBy,
order: Option<GeoSearchOrder>,
count: Option<(usize, bool)>
) -> Future<'_, A>where
K: Into<BulkString>,
M1: Into<BulkString>,
M2: FromValue,
A: FromSingleValueArray<M2>,
sourcefn geosearch_with_options<K, M1, M2, A>(
&self,
key: K,
from: GeoSearchFrom<M1>,
by: GeoSearchBy,
order: Option<GeoSearchOrder>,
count: Option<(usize, bool)>,
with_coord: bool,
with_dist: bool,
with_hash: bool
) -> Future<'_, A>where
K: Into<BulkString>,
M1: Into<BulkString>,
M2: FromValue,
A: FromSingleValueArray<GeoSearchResult<M2>>,
fn geosearch_with_options<K, M1, M2, A>(
&self,
key: K,
from: GeoSearchFrom<M1>,
by: GeoSearchBy,
order: Option<GeoSearchOrder>,
count: Option<(usize, bool)>,
with_coord: bool,
with_dist: bool,
with_hash: bool
) -> Future<'_, A>where
K: Into<BulkString>,
M1: Into<BulkString>,
M2: FromValue,
A: FromSingleValueArray<GeoSearchResult<M2>>,
sourcefn geosearchstore<D, S, M>(
&self,
destination: D,
source: S,
from: GeoSearchFrom<M>,
by: GeoSearchBy,
order: Option<GeoSearchOrder>,
count: Option<(usize, bool)>,
store_dist: bool
) -> Future<'_, usize>where
D: Into<BulkString>,
S: Into<BulkString>,
M: Into<BulkString>,
fn geosearchstore<D, S, M>(
&self,
destination: D,
source: S,
from: GeoSearchFrom<M>,
by: GeoSearchBy,
order: Option<GeoSearchOrder>,
count: Option<(usize, bool)>,
store_dist: bool
) -> Future<'_, usize>where
D: Into<BulkString>,
S: Into<BulkString>,
M: Into<BulkString>,
sourceimpl HashCommands for Transaction
impl HashCommands for Transaction
sourcefn hdel<K, F, C>(&self, key: K, fields: C) -> Future<'_, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
fn hdel<K, F, C>(&self, key: K, fields: C) -> Future<'_, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
Removes the specified fields from the hash stored at key. Read more
sourcefn hexists<K, F>(&self, key: K, field: F) -> Future<'_, bool>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hexists<K, F>(&self, key: K, field: F) -> Future<'_, bool>where
K: Into<BulkString>,
F: Into<BulkString>,
Returns if field is an existing field in the hash stored at key. Read more
sourcefn hget<K, F, V>(&self, key: K, field: F) -> Future<'_, V>where
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
fn hget<K, F, V>(&self, key: K, field: F) -> Future<'_, V>where
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
Returns the value associated with field in the hash stored at key. Read more
sourcefn hgetall<K, F, V, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
fn hgetall<K, F, V, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
Returns all fields and values of the hash stored at key. Read more
sourcefn hincrby<K, F>(&self, key: K, field: F, increment: i64) -> Future<'_, i64>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hincrby<K, F>(&self, key: K, field: F, increment: i64) -> Future<'_, i64>where
K: Into<BulkString>,
F: Into<BulkString>,
Increments the number stored at field in the hash stored at key by increment. Read more
sourcefn hincrbyfloat<K, F>(&self, key: K, field: F, increment: f64) -> Future<'_, f64>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hincrbyfloat<K, F>(&self, key: K, field: F, increment: f64) -> Future<'_, f64>where
K: Into<BulkString>,
F: Into<BulkString>,
Increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment. Read more
sourcefn hkeys<K, F, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
fn hkeys<K, F, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
Returns all field names in the hash stored at key. Read more
sourcefn hlen<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
fn hlen<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
Returns the number of fields contained in the hash stored at key. Read more
sourcefn hmget<K, F, V, C, A>(&self, key: K, fields: C) -> Future<'_, A>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
fn hmget<K, F, V, C, A>(&self, key: K, fields: C) -> Future<'_, A>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
Returns the values associated with the specified fields in the hash stored at key. Read more
sourcefn hrandfield<K, F>(&self, key: K) -> Future<'_, F>where
K: Into<BulkString>,
F: FromValue,
fn hrandfield<K, F>(&self, key: K) -> Future<'_, F>where
K: Into<BulkString>,
F: FromValue,
return random fields from the hash value stored at key. Read more
sourcefn hrandfields<K, F, A>(&self, key: K, count: isize) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
fn hrandfields<K, F, A>(&self, key: K, count: isize) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
return random fields from the hash value stored at key. Read more
sourcefn hrandfields_with_values<K, F, V, A>(
&self,
key: K,
count: isize
) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
fn hrandfields_with_values<K, F, V, A>(
&self,
key: K,
count: isize
) -> Future<'_, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
return random fields from the hash value stored at key. Read more
sourcefn hscan<K, P, F, V>(
&self,
key: K,
cursor: u64,
match_pattern: Option<P>,
count: Option<usize>
) -> Future<'_, (u64, Vec<(F, V)>)>where
K: Into<BulkString>,
P: Into<BulkString>,
F: FromValue + Default,
V: FromValue + Default,
fn hscan<K, P, F, V>(
&self,
key: K,
cursor: u64,
match_pattern: Option<P>,
count: Option<usize>
) -> Future<'_, (u64, Vec<(F, V)>)>where
K: Into<BulkString>,
P: Into<BulkString>,
F: FromValue + Default,
V: FromValue + Default,
Iterates fields of Hash types and their associated values. Read more
sourcefn hset<K, F, V, I>(&self, key: K, items: I) -> Future<'_, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
I: KeyValueArgOrCollection<F, V>,
fn hset<K, F, V, I>(&self, key: K, items: I) -> Future<'_, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
I: KeyValueArgOrCollection<F, V>,
Sets field in the hash stored at key to value. Read more
sourcefn hsetnx<K, F, V>(&self, key: K, field: F, value: V) -> Future<'_, bool>where
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
fn hsetnx<K, F, V>(&self, key: K, field: F, value: V) -> Future<'_, bool>where
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
Sets field in the hash stored at key to value, only if field does not yet exist. Read more
sourcefn hstrlen<K, F>(&self, key: K, field: F) -> Future<'_, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hstrlen<K, F>(&self, key: K, field: F) -> Future<'_, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
Returns the string length of the value associated with field in the hash stored at key. Read more
sourcefn hvals<K, V, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
V: FromValue,
A: FromSingleValueArray<V>,
fn hvals<K, V, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
V: FromValue,
A: FromSingleValueArray<V>,
list of values in the hash, or an empty list when key does not exist. Read more
sourceimpl ListCommands for Transaction
impl ListCommands for Transaction
sourcefn lindex<K, E>(&self, key: K, index: isize) -> Future<'_, E>where
K: Into<BulkString>,
E: FromValue,
fn lindex<K, E>(&self, key: K, index: isize) -> Future<'_, E>where
K: Into<BulkString>,
E: FromValue,
Returns the element at index index in the list stored at key. Read more
sourcefn linsert<K, E>(
&self,
key: K,
where_: LInsertWhere,
pivot: E,
element: E
) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
fn linsert<K, E>(
&self,
key: K,
where_: LInsertWhere,
pivot: E,
element: E
) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
Inserts element in the list stored at key either before or after the reference value pivot. Read more
sourcefn llen<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
fn llen<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
Inserts element in the list stored at key either before or after the reference value pivot. Read more
sourcefn lmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere
) -> Future<'_, E>where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
fn lmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere
) -> Future<'_, E>where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
Atomically returns and removes the first/last element (head/tail depending on the wherefrom argument) of the list stored at source, and pushes the element at the first/last element (head/tail depending on the whereto argument) of the list stored at destination. Read more
sourcefn lmpop<K, E, C>(
&self,
keys: C,
where_: LMoveWhere,
count: usize
) -> Future<'_, (String, Vec<E>)>where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
fn lmpop<K, E, C>(
&self,
keys: C,
where_: LMoveWhere,
count: usize
) -> Future<'_, (String, Vec<E>)>where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
Pops one or more elements from the first non-empty list key from the list of provided key names. Read more
sourcefn lpop<K, E, A>(&self, key: K, count: usize) -> Future<'_, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
fn lpop<K, E, A>(&self, key: K, count: usize) -> Future<'_, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
Removes and returns the first elements of the list stored at key. Read more
sourcefn lpos<K, E>(
&self,
key: K,
element: E,
rank: Option<usize>,
max_len: Option<usize>
) -> Future<'_, Option<usize>>where
K: Into<BulkString>,
E: Into<BulkString>,
fn lpos<K, E>(
&self,
key: K,
element: E,
rank: Option<usize>,
max_len: Option<usize>
) -> Future<'_, Option<usize>>where
K: Into<BulkString>,
E: Into<BulkString>,
Returns the index of matching elements inside a Redis list. Read more
sourcefn lpos_with_count<K, E, A>(
&self,
key: K,
element: E,
num_matches: usize,
rank: Option<usize>,
max_len: Option<usize>
) -> Future<'_, A>where
K: Into<BulkString>,
E: Into<BulkString>,
A: FromSingleValueArray<usize>,
fn lpos_with_count<K, E, A>(
&self,
key: K,
element: E,
num_matches: usize,
rank: Option<usize>,
max_len: Option<usize>
) -> Future<'_, A>where
K: Into<BulkString>,
E: Into<BulkString>,
A: FromSingleValueArray<usize>,
Returns the index of matching elements inside a Redis list. Read more
sourcefn lpush<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
fn lpush<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
Insert all the specified values at the head of the list stored at key Read more
sourcefn lpushx<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
fn lpushx<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
Inserts specified values at the head of the list stored at key, only if key already exists and holds a list. Read more
sourcefn lrange<K, E, A>(&self, key: K, start: isize, stop: isize) -> Future<'_, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
fn lrange<K, E, A>(&self, key: K, start: isize, stop: isize) -> Future<'_, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
Returns the specified elements of the list stored at key. Read more
sourcefn lrem<K, E>(&self, key: K, count: isize, element: E) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
fn lrem<K, E>(&self, key: K, count: isize, element: E) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
Removes the first count occurrences of elements equal to element from the list stored at key. Read more
sourcefn lset<K, E>(&self, key: K, index: isize, element: E) -> Future<'_, ()>where
K: Into<BulkString>,
E: Into<BulkString>,
fn lset<K, E>(&self, key: K, index: isize, element: E) -> Future<'_, ()>where
K: Into<BulkString>,
E: Into<BulkString>,
Sets the list element at index to element. Read more
sourcefn ltrim<K>(&self, key: K, start: isize, stop: isize) -> Future<'_, ()>where
K: Into<BulkString>,
fn ltrim<K>(&self, key: K, start: isize, stop: isize) -> Future<'_, ()>where
K: Into<BulkString>,
Trim an existing list so that it will contain only the specified range of elements specified. Read more
sourcefn rpop<K, E, C>(&self, key: K, count: usize) -> Future<'_, C>where
K: Into<BulkString>,
E: FromValue,
C: FromSingleValueArray<E>,
fn rpop<K, E, C>(&self, key: K, count: usize) -> Future<'_, C>where
K: Into<BulkString>,
E: FromValue,
C: FromSingleValueArray<E>,
Removes and returns the first elements of the list stored at key. Read more
sourcefn rpush<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
fn rpush<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
Insert all the specified values at the tail of the list stored at key Read more
sourcefn rpushx<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
fn rpushx<K, E, C>(&self, key: K, elements: C) -> Future<'_, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list. Read more
sourceimpl ServerCommands for Transaction
impl ServerCommands for Transaction
sourceimpl SetCommands for Transaction
impl SetCommands for Transaction
sourcefn sadd<K, M, C>(&self, key: K, members: C) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn sadd<K, M, C>(&self, key: K, members: C) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Add the specified members to the set stored at key. Read more
sourcefn scard<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
fn scard<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
Returns the set cardinality (number of elements) of the set stored at key. Read more
sourcefn sdiff<K, M, C, A>(&self, keys: C) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
C: SingleArgOrCollection<K>,
A: FromSingleValueArray<M>,
fn sdiff<K, M, C, A>(&self, keys: C) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
C: SingleArgOrCollection<K>,
A: FromSingleValueArray<M>,
Returns the members of the set resulting from the difference between the first set and all the successive sets. Read more
sourcefn sdiffstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn sdiffstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourcefn sinter<K, M, C, A>(&self, keys: C) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
C: SingleArgOrCollection<K>,
A: FromSingleValueArray<M>,
fn sinter<K, M, C, A>(&self, keys: C) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
C: SingleArgOrCollection<K>,
A: FromSingleValueArray<M>,
Returns the members of the set resulting from the intersection of all the given sets. Read more
sourcefn sintercard<K, C>(&self, keys: C, limit: usize) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn sintercard<K, C>(&self, keys: C, limit: usize) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourcefn sinterstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn sinterstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourcefn sismember<K, M>(&self, key: K, member: M) -> Future<'_, bool>where
K: Into<BulkString>,
M: Into<BulkString>,
fn sismember<K, M>(&self, key: K, member: M) -> Future<'_, bool>where
K: Into<BulkString>,
M: Into<BulkString>,
Returns if member is a member of the set stored at key. Read more
sourcefn smembers<K, M, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
A: FromSingleValueArray<M>,
fn smembers<K, M, A>(&self, key: K) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
A: FromSingleValueArray<M>,
Returns all the members of the set value stored at key. Read more
sourcefn smismember<K, M, C>(&self, key: K, members: C) -> Future<'_, Vec<bool>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn smismember<K, M, C>(&self, key: K, members: C) -> Future<'_, Vec<bool>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Returns whether each member is a member of the set stored at key. Read more
sourcefn smove<S, D, M>(&self, source: S, destination: D, member: M) -> Future<'_, bool>where
S: Into<BulkString>,
D: Into<BulkString>,
M: Into<BulkString>,
fn smove<S, D, M>(&self, source: S, destination: D, member: M) -> Future<'_, bool>where
S: Into<BulkString>,
D: Into<BulkString>,
M: Into<BulkString>,
Move member from the set at source to the set at destination. Read more
sourcefn spop<K, M, A>(&self, key: K, count: usize) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
A: FromSingleValueArray<M>,
fn spop<K, M, A>(&self, key: K, count: usize) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
A: FromSingleValueArray<M>,
Removes and returns one or more random members from the set value store at key. Read more
sourcefn srandmember<K, M, A>(&self, key: K, count: usize) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
A: FromSingleValueArray<M>,
fn srandmember<K, M, A>(&self, key: K, count: usize) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
A: FromSingleValueArray<M>,
Removes and returns one or more random members from the set value store at key. Read more
sourcefn srem<K, M, C>(&self, key: K, members: C) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn srem<K, M, C>(&self, key: K, members: C) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Remove the specified members from the set stored at key. Read more
sourcefn sscan<K, P, M>(
&self,
key: K,
cursor: u64,
match_pattern: Option<P>,
count: Option<usize>
) -> Future<'_, (u64, Vec<M>)>where
K: Into<BulkString>,
P: Into<BulkString>,
M: FromValue,
fn sscan<K, P, M>(
&self,
key: K,
cursor: u64,
match_pattern: Option<P>,
count: Option<usize>
) -> Future<'_, (u64, Vec<M>)>where
K: Into<BulkString>,
P: Into<BulkString>,
M: FromValue,
Iterates elements of Sets types. Read more
sourcefn sunion<K, M, C, A>(&self, keys: C) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
C: SingleArgOrCollection<K>,
A: FromSingleValueArray<M>,
fn sunion<K, M, C, A>(&self, keys: C) -> Future<'_, A>where
K: Into<BulkString>,
M: FromValue + Eq + Hash,
C: SingleArgOrCollection<K>,
A: FromSingleValueArray<M>,
Returns the members of the set resulting from the union of all the given sets. Read more
sourcefn sunionstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn sunionstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourceimpl SortedSetCommands for Transaction
impl SortedSetCommands for Transaction
sourcefn zadd<K, M, I>(
&self,
key: K,
items: I,
options: ZAddOptions
) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, M)>,
fn zadd<K, M, I>(
&self,
key: K,
items: I,
options: ZAddOptions
) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, M)>,
Adds all the specified members with the specified scores to the sorted set stored at key. Read more
sourcefn zadd_incr<K, M>(
&self,
key: K,
condition: Option<ZAddCondition>,
comparison: Option<ZAddComparison>,
change: bool,
score: f64,
member: M
) -> Future<'_, Option<f64>>where
K: Into<BulkString>,
M: Into<BulkString>,
fn zadd_incr<K, M>(
&self,
key: K,
condition: Option<ZAddCondition>,
comparison: Option<ZAddComparison>,
change: bool,
score: f64,
member: M
) -> Future<'_, Option<f64>>where
K: Into<BulkString>,
M: Into<BulkString>,
In this mode ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode. Read more
sourcefn zcard<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
fn zcard<K>(&self, key: K) -> Future<'_, usize>where
K: Into<BulkString>,
Returns the sorted set cardinality (number of elements) of the sorted set stored at key. Read more
sourcefn zcount<K, T, U>(&self, key: K, min: T, max: U) -> Future<'_, usize>where
K: Into<BulkString>,
T: Into<BulkString>,
U: Into<BulkString>,
fn zcount<K, T, U>(&self, key: K, min: T, max: U) -> Future<'_, usize>where
K: Into<BulkString>,
T: Into<BulkString>,
U: Into<BulkString>,
Returns the number of elements in the sorted set at key with a score between min and max. Read more
sourcefn zdiff<K, C, E>(&self, keys: C) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
E: FromValue,
fn zdiff<K, C, E>(&self, keys: C) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
E: FromValue,
This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
sourcefn zdiff_with_scores<K, C, E>(&self, keys: C) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
E: FromValue + Default,
fn zdiff_with_scores<K, C, E>(&self, keys: C) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
E: FromValue + Default,
This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
sourcefn zdiffstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn zdiffstore<D, K, C>(&self, destination: D, keys: C) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
Computes the difference between the first and all successive input sorted sets and stores the result in destination. Read more
sourcefn zincrby<K, M>(&self, key: K, increment: f64, member: M) -> Future<'_, f64>where
K: Into<BulkString>,
M: Into<BulkString>,
fn zincrby<K, M>(&self, key: K, increment: f64, member: M) -> Future<'_, f64>where
K: Into<BulkString>,
M: Into<BulkString>,
Increments the score of member in the sorted set stored at key by increment. Read more
sourcefn zinter<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
fn zinter<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
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. Read more
sourcefn zinter_with_scores<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue + Default,
fn zinter_with_scores<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue + Default,
This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
sourcefn zintercard<K, C>(&self, keys: C, limit: usize) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn zintercard<K, C>(&self, keys: C, limit: usize) -> Future<'_, usize>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourcefn zinterstore<D, K, C, W>(
&self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
fn zinterstore<D, K, C, W>(
&self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination. Read more
sourcefn zlexcount<K, M1, M2>(&self, key: K, min: M1, max: M2) -> Future<'_, usize>where
K: Into<BulkString>,
M1: Into<BulkString>,
M2: Into<BulkString>,
fn zlexcount<K, M1, M2>(&self, key: K, min: M1, max: M2) -> Future<'_, usize>where
K: Into<BulkString>,
M1: Into<BulkString>,
M2: Into<BulkString>,
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max. Read more
sourcefn zmpop<K, C, E>(
&self,
keys: C,
where_: ZWhere,
count: usize
) -> Future<'_, Option<(String, Vec<(E, f64)>)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
E: FromValue + Default,
fn zmpop<K, C, E>(
&self,
keys: C,
where_: ZWhere,
count: usize
) -> Future<'_, Option<(String, Vec<(E, f64)>)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
E: FromValue + Default,
Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names. Read more
sourcefn zmscore<K, M, C>(&self, key: K, members: C) -> Future<'_, Vec<Option<f64>>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn zmscore<K, M, C>(&self, key: K, members: C) -> Future<'_, Vec<Option<f64>>>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Returns the scores associated with the specified members in the sorted set stored at key. Read more
sourcefn zpopmax<K, M>(&self, key: K, count: usize) -> Future<'_, Vec<(M, f64)>>where
K: Into<BulkString>,
M: FromValue + Default,
fn zpopmax<K, M>(&self, key: K, count: usize) -> Future<'_, Vec<(M, f64)>>where
K: Into<BulkString>,
M: FromValue + Default,
Removes and returns up to count members with the highest scores in the sorted set stored at key. Read more
sourcefn zpopmin<K, M>(&self, key: K, count: usize) -> Future<'_, Vec<(M, f64)>>where
K: Into<BulkString>,
M: FromValue + Default,
fn zpopmin<K, M>(&self, key: K, count: usize) -> Future<'_, Vec<(M, f64)>>where
K: Into<BulkString>,
M: FromValue + Default,
Removes and returns up to count members with the lowest scores in the sorted set stored at key. Read more
sourcefn zrandmember<K, E>(&self, key: K) -> Future<'_, E>where
K: Into<BulkString>,
E: FromValue,
fn zrandmember<K, E>(&self, key: K) -> Future<'_, E>where
K: Into<BulkString>,
E: FromValue,
Return a random element from the sorted set value stored at key. Read more
sourcefn zrandmembers<K, E>(&self, key: K, count: isize) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
E: FromValue,
fn zrandmembers<K, E>(&self, key: K, count: isize) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
E: FromValue,
Return random elements from the sorted set value stored at key. Read more
sourcefn zrandmembers_with_scores<K, E>(
&self,
key: K,
count: isize
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
E: FromValue,
fn zrandmembers_with_scores<K, E>(
&self,
key: K,
count: isize
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
E: FromValue,
Return random elements with their scores from the sorted set value stored at key. Read more
sourcefn zrange<K, S, E>(
&self,
key: K,
start: S,
stop: S,
options: ZRangeOptions
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
S: Into<BulkString>,
E: FromValue,
fn zrange<K, S, E>(
&self,
key: K,
start: S,
stop: S,
options: ZRangeOptions
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
S: Into<BulkString>,
E: FromValue,
Returns the specified range of elements in the sorted set stored at key
. Read more
sourcefn zrange_with_scores<K, S, E>(
&self,
key: K,
start: S,
stop: S,
options: ZRangeOptions
) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
S: Into<BulkString>,
E: FromValue + Default,
fn zrange_with_scores<K, S, E>(
&self,
key: K,
start: S,
stop: S,
options: ZRangeOptions
) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
S: Into<BulkString>,
E: FromValue + Default,
Returns the specified range of elements in the sorted set stored at key
. Read more
sourcefn zrangestore<D, S, T>(
&self,
dst: D,
src: S,
start: T,
stop: T,
sort_by: Option<ZRangeSortBy>,
reverse: bool,
limit: Option<(usize, isize)>
) -> Future<'_, usize>where
D: Into<BulkString>,
S: Into<BulkString>,
T: Into<BulkString>,
fn zrangestore<D, S, T>(
&self,
dst: D,
src: S,
start: T,
stop: T,
sort_by: Option<ZRangeSortBy>,
reverse: bool,
limit: Option<(usize, isize)>
) -> Future<'_, usize>where
D: Into<BulkString>,
S: Into<BulkString>,
T: Into<BulkString>,
sourcefn zrank<K, M>(&self, key: K, member: M) -> Future<'_, Option<usize>>where
K: Into<BulkString>,
M: Into<BulkString>,
fn zrank<K, M>(&self, key: K, member: M) -> Future<'_, Option<usize>>where
K: Into<BulkString>,
M: Into<BulkString>,
Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. Read more
sourcefn zrem<K, M, C>(&self, key: K, members: C) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn zrem<K, M, C>(&self, key: K, members: C) -> Future<'_, usize>where
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Removes the specified members from the sorted set stored at key. Read more
sourcefn zremrangebylex<K, S>(&self, key: K, start: S, stop: S) -> Future<'_, usize>where
K: Into<BulkString>,
S: Into<BulkString>,
fn zremrangebylex<K, S>(&self, key: K, start: S, stop: S) -> Future<'_, usize>where
K: Into<BulkString>,
S: Into<BulkString>,
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max. Read more
sourcefn zremrangebyrank<K>(
&self,
key: K,
start: isize,
stop: isize
) -> Future<'_, usize>where
K: Into<BulkString>,
fn zremrangebyrank<K>(
&self,
key: K,
start: isize,
stop: isize
) -> Future<'_, usize>where
K: Into<BulkString>,
Removes all elements in the sorted set stored at key with rank between start and stop. Read more
sourcefn zremrangebyscore<K, S>(&self, key: K, start: S, stop: S) -> Future<'_, usize>where
K: Into<BulkString>,
S: Into<BulkString>,
fn zremrangebyscore<K, S>(&self, key: K, start: S, stop: S) -> Future<'_, usize>where
K: Into<BulkString>,
S: Into<BulkString>,
Removes all elements in the sorted set stored at key with a score between min and max (inclusive). Read more
sourcefn zrevrank<K, M>(&self, key: K, member: M) -> Future<'_, Option<usize>>where
K: Into<BulkString>,
M: Into<BulkString>,
fn zrevrank<K, M>(&self, key: K, member: M) -> Future<'_, Option<usize>>where
K: Into<BulkString>,
M: Into<BulkString>,
Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. Read more
sourcefn zscan<K, P, M>(
&self,
key: K,
cursor: usize,
match_pattern: Option<P>,
count: Option<usize>
) -> Future<'_, (u64, Vec<(M, f64)>)>where
K: Into<BulkString>,
P: Into<BulkString>,
M: FromValue + Default,
fn zscan<K, P, M>(
&self,
key: K,
cursor: usize,
match_pattern: Option<P>,
count: Option<usize>
) -> Future<'_, (u64, Vec<(M, f64)>)>where
K: Into<BulkString>,
P: Into<BulkString>,
M: FromValue + Default,
Iterates elements of Sorted Set types and their associated scores. Read more
sourcefn zscore<K, M>(&self, key: K, member: M) -> Future<'_, Option<f64>>where
K: Into<BulkString>,
M: Into<BulkString>,
fn zscore<K, M>(&self, key: K, member: M) -> Future<'_, Option<f64>>where
K: Into<BulkString>,
M: Into<BulkString>,
Returns the score of member in the sorted set at key. Read more
sourcefn zunion<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue,
fn zunion<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<E>>where
K: Into<BulkString>,
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. Read more
sourcefn zunion_with_scores<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue + Default,
fn zunion_with_scores<K, C, W, E>(
&self,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, Vec<(E, f64)>>where
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
E: FromValue + Default,
This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
sourcefn zunionstore<D, K, C, W>(
&self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
fn zunionstore<D, K, C, W>(
&self,
destination: D,
keys: C,
weights: Option<W>,
aggregate: Option<ZAggregate>
) -> Future<'_, usize>where
D: Into<BulkString>,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
W: SingleArgOrCollection<f64>,
Computes the unionsection of numkeys sorted sets given by the specified keys, and stores the result in destination. Read more
sourceimpl StringCommands for Transaction
impl StringCommands for Transaction
sourcefn append<K, V>(&self, key: K, value: V) -> Future<'_, usize>where
K: Into<BulkString>,
V: Into<BulkString>,
fn append<K, V>(&self, key: K, value: V) -> Future<'_, usize>where
K: Into<BulkString>,
V: Into<BulkString>,
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case. Read more
sourcefn decr<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn decr<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
Decrements the number stored at key by one. Read more
sourcefn decrby<K>(&self, key: K, decrement: i64) -> Future<'_, i64>where
K: Into<BulkString>,
fn decrby<K>(&self, key: K, decrement: i64) -> Future<'_, i64>where
K: Into<BulkString>,
Decrements the number stored at key by one. Read more
sourcefn get<K, V>(&self, key: K) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
Self: Sized,
fn get<K, V>(&self, key: K) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
Self: Sized,
Get the value of key. Read more
sourcefn getdel<K, V>(&self, key: K) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
fn getdel<K, V>(&self, key: K) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
Get the value of key and delete the key. Read more
sourcefn getex<K, V>(&self, key: K, options: GetExOptions) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
fn getex<K, V>(&self, key: K, options: GetExOptions) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
Get the value of key and optionally set its expiration. GETEX is similar to GET, but is a write command with additional options. Read more
sourcefn getrange<K, V>(&self, key: K, start: usize, end: isize) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
fn getrange<K, V>(&self, key: K, start: usize, end: isize) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive). Read more
sourcefn getset<K, V, R>(&self, key: K, value: V) -> Future<'_, R>where
K: Into<BulkString>,
V: Into<BulkString>,
R: FromValue,
fn getset<K, V, R>(&self, key: K, value: V) -> Future<'_, R>where
K: Into<BulkString>,
V: Into<BulkString>,
R: FromValue,
Atomically sets key to value and returns the old value stored at key. Returns an error when key exists but does not hold a string value. Any previous time to live associated with the key is discarded on successful SET operation. Read more
sourcefn incr<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
fn incr<K>(&self, key: K) -> Future<'_, i64>where
K: Into<BulkString>,
Increments the number stored at key by one. Read more
sourcefn incrby<K>(&self, key: K, increment: i64) -> Future<'_, i64>where
K: Into<BulkString>,
fn incrby<K>(&self, key: K, increment: i64) -> Future<'_, i64>where
K: Into<BulkString>,
Increments the number stored at key by increment. Read more
sourcefn incrbyfloat<K>(&self, key: K, increment: f64) -> Future<'_, f64>where
K: Into<BulkString>,
fn incrbyfloat<K>(&self, key: K, increment: f64) -> Future<'_, f64>where
K: Into<BulkString>,
Increment the string representing a floating point number stored at key by the specified increment. By using a negative increment value, the result is that the value stored at the key is decremented (by the obvious properties of addition). If the key does not exist, it is set to 0 before performing the operation. An error is returned if one of the following conditions occur: Read more
sourcefn lcs<K, V>(&self, key1: K, key2: K) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
fn lcs<K, V>(&self, key1: K, key2: K) -> Future<'_, V>where
K: Into<BulkString>,
V: FromValue,
The LCS command implements the longest common subsequence algorithm Read more
sourcefn lcs_len<K>(&self, key1: K, key2: K) -> Future<'_, usize>where
K: Into<BulkString>,
fn lcs_len<K>(&self, key1: K, key2: K) -> Future<'_, usize>where
K: Into<BulkString>,
The LCS command implements the longest common subsequence algorithm Read more
sourcefn lcs_idx<K>(
&self,
key1: K,
key2: K,
min_match_len: Option<usize>,
with_match_len: bool
) -> Future<'_, LcsResult>where
K: Into<BulkString>,
fn lcs_idx<K>(
&self,
key1: K,
key2: K,
min_match_len: Option<usize>,
with_match_len: bool
) -> Future<'_, LcsResult>where
K: Into<BulkString>,
The LCS command implements the longest common subsequence algorithm Read more
sourcefn mget<'a, K, V, C>(&'a self, keys: C) -> Future<'_, Vec<Option<V>>>where
K: Into<BulkString>,
V: FromValue,
C: SingleArgOrCollection<K>,
fn mget<'a, K, V, C>(&'a self, keys: C) -> Future<'_, Vec<Option<V>>>where
K: Into<BulkString>,
V: FromValue,
C: SingleArgOrCollection<K>,
Returns the values of all specified keys. Read more
sourcefn mset<'a, K, V, C>(&'a self, items: C) -> Future<'_, ()>where
C: KeyValueArgOrCollection<K, V>,
K: Into<BulkString>,
V: Into<BulkString>,
fn mset<'a, K, V, C>(&'a self, items: C) -> Future<'_, ()>where
C: KeyValueArgOrCollection<K, V>,
K: Into<BulkString>,
V: Into<BulkString>,
Sets the given keys to their respective values. Read more
sourcefn msetnx<'a, K, V, C>(&'a self, items: C) -> Future<'_, bool>where
C: KeyValueArgOrCollection<K, V>,
K: Into<BulkString>,
V: Into<BulkString>,
fn msetnx<'a, K, V, C>(&'a self, items: C) -> Future<'_, bool>where
C: KeyValueArgOrCollection<K, V>,
K: Into<BulkString>,
V: Into<BulkString>,
Sets the given keys to their respective values. MSETNX will not perform any operation at all even if just a single key already exists. Read more
sourcefn psetex<K, V>(&self, key: K, milliseconds: u64, value: V) -> Future<'_, ()>where
K: Into<BulkString>,
V: Into<BulkString>,
fn psetex<K, V>(&self, key: K, milliseconds: u64, value: V) -> Future<'_, ()>where
K: Into<BulkString>,
V: Into<BulkString>,
sourcefn set<K, V>(&self, key: K, value: V) -> Future<'_, ()>where
K: Into<BulkString>,
V: Into<BulkString>,
Self: Sized,
fn set<K, V>(&self, key: K, value: V) -> Future<'_, ()>where
K: Into<BulkString>,
V: Into<BulkString>,
Self: Sized,
Set key to hold the string value. Read more
sourcefn set_with_options<K, V>(
&self,
key: K,
value: V,
condition: Option<SetCondition>,
expiration: Option<SetExpiration>,
keep_ttl: bool
) -> Future<'_, bool>where
K: Into<BulkString>,
V: Into<BulkString>,
fn set_with_options<K, V>(
&self,
key: K,
value: V,
condition: Option<SetCondition>,
expiration: Option<SetExpiration>,
keep_ttl: bool
) -> Future<'_, bool>where
K: Into<BulkString>,
V: Into<BulkString>,
Set key to hold the string value. Read more
sourcefn set_get_with_options<K, V1, V2>(
&self,
key: K,
value: V1,
condition: Option<SetCondition>,
expiration: Option<SetExpiration>,
keep_ttl: bool
) -> Future<'_, V2>where
K: Into<BulkString>,
V1: Into<BulkString>,
V2: FromValue,
fn set_get_with_options<K, V1, V2>(
&self,
key: K,
value: V1,
condition: Option<SetCondition>,
expiration: Option<SetExpiration>,
keep_ttl: bool
) -> Future<'_, V2>where
K: Into<BulkString>,
V1: Into<BulkString>,
V2: FromValue,
Set key to hold the string value wit GET option enforced Read more
sourcefn setex<K, V>(&self, key: K, seconds: u64, value: V) -> Future<'_, ()>where
K: Into<BulkString>,
V: Into<BulkString>,
fn setex<K, V>(&self, key: K, seconds: u64, value: V) -> Future<'_, ()>where
K: Into<BulkString>,
V: Into<BulkString>,
Set key to hold the string value and set key to timeout after a given number of seconds. Read more
sourcefn setnx<K, V>(&self, key: K, value: V) -> Future<'_, bool>where
K: Into<BulkString>,
V: Into<BulkString>,
fn setnx<K, V>(&self, key: K, value: V) -> Future<'_, bool>where
K: Into<BulkString>,
V: Into<BulkString>,
Set key to hold string value if key does not exist. Read more
sourcefn setrange<K, V>(&self, key: K, offset: usize, value: V) -> Future<'_, usize>where
K: Into<BulkString>,
V: Into<BulkString>,
fn setrange<K, V>(&self, key: K, offset: usize, value: V) -> Future<'_, usize>where
K: Into<BulkString>,
V: Into<BulkString>,
Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl !UnwindSafe for Transaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more