pub struct Json<T>(pub T);
Expand description
JSON extractor and responder.
Json
has two uses: JSON responses, and extracting typed data from JSON request payloads.
§Extractor
To extract typed data from a request body, the inner type T
must implement the
serde::Deserialize
trait.
Use JsonConfig
to configure extraction options.
use actix_web::{post, web, App};
use serde::Deserialize;
#[derive(Deserialize)]
struct Info {
username: String,
}
/// deserialize `Info` from request's body
#[post("/")]
async fn index(info: web::Json<Info>) -> String {
format!("Welcome {}!", info.username)
}
§Responder
The Json
type JSON formatted responses. A handler may return a value of type
Json<T>
where T
is the type of a structure to serialize into JSON. The type T
must
implement serde::Serialize
.
use actix_web::{post, web, HttpRequest};
use serde::Serialize;
#[derive(Serialize)]
struct Info {
name: String,
}
#[post("/{name}")]
async fn index(req: HttpRequest) -> web::Json<Info> {
web::Json(Info {
name: req.match_info().get("name").unwrap().to_owned(),
})
}
Tuple Fields§
§0: T
Implementations§
Source§impl<T> Json<T>
impl<T> Json<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap into inner T
value.
Trait Implementations§
Source§impl<T> FromRequest for Json<T>where
T: DeserializeOwned,
See here for example of usage as an extractor.
impl<T> FromRequest for Json<T>where
T: DeserializeOwned,
See here for example of usage as an extractor.
Source§type Future = JsonExtractFut<T>
type Future = JsonExtractFut<T>
Future that resolves to a
Self
. Read moreSource§fn from_request(
req: &HttpRequest,
payload: &mut Payload,
) -> <Json<T> as FromRequest>::Future
fn from_request( req: &HttpRequest, payload: &mut Payload, ) -> <Json<T> as FromRequest>::Future
Create a
Self
from request parts asynchronously.Source§impl<T> Responder for Json<T>where
T: Serialize,
Creates response with OK status code, correct content type header, and serialized JSON payload.
impl<T> Responder for Json<T>where
T: Serialize,
Creates response with OK status code, correct content type header, and serialized JSON payload.
If serialization failed
type Body = EitherBody<String>
Source§fn respond_to(
self,
_: &HttpRequest,
) -> HttpResponse<<Json<T> as Responder>::Body>
fn respond_to( self, _: &HttpRequest, ) -> HttpResponse<<Json<T> as Responder>::Body>
Convert self to
HttpResponse
.Source§impl<T> Serialize for Json<T>where
T: Serialize,
impl<T> Serialize for Json<T>where
T: Serialize,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<T> Freeze for Json<T>where
T: Freeze,
impl<T> RefUnwindSafe for Json<T>where
T: RefUnwindSafe,
impl<T> Send for Json<T>where
T: Send,
impl<T> Sync for Json<T>where
T: Sync,
impl<T> Unpin for Json<T>where
T: Unpin,
impl<T> UnwindSafe for Json<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> Commands for Twhere
T: ConnectionLike,
impl<T> Commands for Twhere
T: ConnectionLike,
Source§fn get<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn get<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the value of a key. If key is a vec this becomes an
MGET
(if using TypedCommands
, you should specifically use mget
to get the correct return type.
Redis DocsSource§fn mget<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn mget<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get values of keys
Redis Docs
Source§fn keys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn keys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Gets all keys matching pattern
Redis Docs
Source§fn set<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
fn set<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
Set the string value of a key.
Redis Docs
Source§fn set_options<'a, K, V, RV>(
&mut self,
key: K,
value: V,
options: SetOptions,
) -> Result<RV, RedisError>
fn set_options<'a, K, V, RV>( &mut self, key: K, value: V, options: SetOptions, ) -> Result<RV, RedisError>
Set the string value of a key with options.
Redis Docs
Source§fn set_multiple<'a, K, V, RV>(
&mut self,
items: &'a [(K, V)],
) -> Result<RV, RedisError>
fn set_multiple<'a, K, V, RV>( &mut self, items: &'a [(K, V)], ) -> Result<RV, RedisError>
👎Deprecated since 0.22.4: Renamed to mset() to reflect Redis name
Sets multiple keys to their values.
Redis Docs
Source§fn mset<'a, K, V, RV>(&mut self, items: &'a [(K, V)]) -> Result<RV, RedisError>
fn mset<'a, K, V, RV>(&mut self, items: &'a [(K, V)]) -> Result<RV, RedisError>
Sets multiple keys to their values.
Redis Docs
Source§fn set_ex<'a, K, V, RV>(
&mut self,
key: K,
value: V,
seconds: u64,
) -> Result<RV, RedisError>
fn set_ex<'a, K, V, RV>( &mut self, key: K, value: V, seconds: u64, ) -> Result<RV, RedisError>
Set the value and expiration of a key.
Redis Docs
Source§fn pset_ex<'a, K, V, RV>(
&mut self,
key: K,
value: V,
milliseconds: u64,
) -> Result<RV, RedisError>
fn pset_ex<'a, K, V, RV>( &mut self, key: K, value: V, milliseconds: u64, ) -> Result<RV, RedisError>
Set the value and expiration in milliseconds of a key.
Redis Docs
Source§fn set_nx<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
fn set_nx<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
Set the value of a key, only if the key does not exist
Redis Docs
Source§fn mset_nx<'a, K, V, RV>(
&mut self,
items: &'a [(K, V)],
) -> Result<RV, RedisError>
fn mset_nx<'a, K, V, RV>( &mut self, items: &'a [(K, V)], ) -> Result<RV, RedisError>
Sets multiple keys to their values failing if at least one already exists.
Redis Docs
Source§fn getset<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
fn getset<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
Set the string value of a key and return its old value.
Redis Docs
Source§fn getrange<'a, K, RV>(
&mut self,
key: K,
from: isize,
to: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn getrange<'a, K, RV>(
&mut self,
key: K,
from: isize,
to: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get a range of bytes/substring from the value of a key. Negative values provide an offset from the end of the value.
Redis returns an empty string if the key doesn’t exist, not Nil
Redis Docs
Source§fn setrange<'a, K, V, RV>(
&mut self,
key: K,
offset: isize,
value: V,
) -> Result<RV, RedisError>
fn setrange<'a, K, V, RV>( &mut self, key: K, offset: isize, value: V, ) -> Result<RV, RedisError>
Overwrite the part of the value stored in key at the specified offset.
Redis Docs
Source§fn del<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn del<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Delete one or more keys.
Returns the number of keys deleted.
Redis Docs
Source§fn exists<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn exists<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Determine if a key exists.
Redis Docs
Source§fn key_type<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn key_type<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Determine the type of key.
Redis Docs
Source§fn expire<'a, K, RV>(&mut self, key: K, seconds: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn expire<'a, K, RV>(&mut self, key: K, seconds: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Set a key’s time to live in seconds.
Returns whether expiration was set.
Redis Docs
Source§fn expire_at<'a, K, RV>(&mut self, key: K, ts: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn expire_at<'a, K, RV>(&mut self, key: K, ts: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Set the expiration for a key as a UNIX timestamp.
Returns whether expiration was set.
Redis Docs
Source§fn pexpire<'a, K, RV>(&mut self, key: K, ms: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn pexpire<'a, K, RV>(&mut self, key: K, ms: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Set a key’s time to live in milliseconds.
Returns whether expiration was set.
Redis Docs
Source§fn pexpire_at<'a, K, RV>(&mut self, key: K, ts: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn pexpire_at<'a, K, RV>(&mut self, key: K, ts: i64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Set the expiration for a key as a UNIX timestamp in milliseconds.
Returns whether expiration was set.
Redis Docs
Source§fn expire_time<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn expire_time<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the absolute Unix expiration timestamp in seconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn pexpire_time<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn pexpire_time<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the absolute Unix expiration timestamp in milliseconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn persist<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn persist<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Remove the expiration from a key.
Returns whether a timeout was removed.
Redis Docs
Source§fn ttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn ttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the time to live for a key in seconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn pttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn pttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the time to live for a key in milliseconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn get_ex<'a, K, RV>(
&mut self,
key: K,
expire_at: Expiry,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn get_ex<'a, K, RV>(
&mut self,
key: K,
expire_at: Expiry,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the value of a key and set expiration
Redis Docs
Source§fn get_del<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn get_del<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the value of a key and delete it
Redis Docs
Source§fn copy<'a, KSrc, KDst, Db, RV>(
&mut self,
source: KSrc,
destination: KDst,
options: CopyOptions<Db>,
) -> Result<RV, RedisError>
fn copy<'a, KSrc, KDst, Db, RV>( &mut self, source: KSrc, destination: KDst, options: CopyOptions<Db>, ) -> Result<RV, RedisError>
Copy the value from one key to another, returning whether the copy was successful.
Redis Docs
Source§fn rename<'a, K, N, RV>(&mut self, key: K, new_key: N) -> Result<RV, RedisError>
fn rename<'a, K, N, RV>(&mut self, key: K, new_key: N) -> Result<RV, RedisError>
Rename a key.
Errors if key does not exist.
Redis Docs
Source§fn rename_nx<'a, K, N, RV>(
&mut self,
key: K,
new_key: N,
) -> Result<RV, RedisError>
fn rename_nx<'a, K, N, RV>( &mut self, key: K, new_key: N, ) -> Result<RV, RedisError>
Rename a key, only if the new key does not exist.
Errors if key does not exist.
Returns whether the key was renamed, or false if the new key already exists.
Redis Docs
Source§fn unlink<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn unlink<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Unlink one or more keys. This is a non-blocking version of
DEL
.
Returns number of keys unlinked.
Redis DocsSource§fn append<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
fn append<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
Append a value to a key.
Returns length of string after operation.
Redis Docs
Source§fn incr<'a, K, V, RV>(&mut self, key: K, delta: V) -> Result<RV, RedisError>
fn incr<'a, K, V, RV>(&mut self, key: K, delta: V) -> Result<RV, RedisError>
Increment the numeric value of a key by the given amount. This
issues a
INCRBY
or INCRBYFLOAT
depending on the type.
If the key does not exist, it is set to 0 before performing the operation.Source§fn decr<'a, K, V, RV>(&mut self, key: K, delta: V) -> Result<RV, RedisError>
fn decr<'a, K, V, RV>(&mut self, key: K, delta: V) -> Result<RV, RedisError>
Decrement the numeric value of a key by the given amount.
If the key does not exist, it is set to 0 before performing the operation.
Redis Docs
Source§fn setbit<'a, K, RV>(
&mut self,
key: K,
offset: usize,
value: bool,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn setbit<'a, K, RV>(
&mut self,
key: K,
offset: usize,
value: bool,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Sets or clears the bit at offset in the string value stored at key.
Returns the original bit value stored at offset.
Redis Docs
Source§fn getbit<'a, K, RV>(&mut self, key: K, offset: usize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn getbit<'a, K, RV>(&mut self, key: K, offset: usize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the bit value at offset in the string value stored at key.
Redis Docs
Source§fn bitcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn bitcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Count set bits in a string.
Returns 0 if key does not exist.
Redis Docs
Source§fn bitcount_range<'a, K, RV>(
&mut self,
key: K,
start: usize,
end: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn bitcount_range<'a, K, RV>(
&mut self,
key: K,
start: usize,
end: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Count set bits in a string in a range.
Returns 0 if key does not exist.
Redis Docs
Source§fn bit_and<'a, D, S, RV>(
&mut self,
dstkey: D,
srckeys: S,
) -> Result<RV, RedisError>
fn bit_and<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>
Perform a bitwise AND between multiple keys (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“AND)
Source§fn bit_or<'a, D, S, RV>(
&mut self,
dstkey: D,
srckeys: S,
) -> Result<RV, RedisError>
fn bit_or<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>
Perform a bitwise OR between multiple keys (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“OR)
Source§fn bit_xor<'a, D, S, RV>(
&mut self,
dstkey: D,
srckeys: S,
) -> Result<RV, RedisError>
fn bit_xor<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>
Perform a bitwise XOR between multiple keys (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“XOR)
Source§fn bit_not<'a, D, S, RV>(
&mut self,
dstkey: D,
srckey: S,
) -> Result<RV, RedisError>
fn bit_not<'a, D, S, RV>( &mut self, dstkey: D, srckey: S, ) -> Result<RV, RedisError>
Perform a bitwise NOT of the key (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“NOT)
Source§fn strlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn strlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the length of the value stored in a key.
0 if key does not exist.
Redis Docs
Source§fn hget<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
fn hget<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
Gets a single (or multiple) fields from a hash.
Source§fn hget_ex<'a, K, F, RV>(
&mut self,
key: K,
fields: F,
expire_at: Expiry,
) -> Result<RV, RedisError>
fn hget_ex<'a, K, F, RV>( &mut self, key: K, fields: F, expire_at: Expiry, ) -> Result<RV, RedisError>
Get the value of one or more fields of a given hash key, and optionally set their expiration
Redis Docs.arg(key).arg(expire_at).arg(“FIELDS)
Source§fn hdel<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
fn hdel<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
Deletes a single (or multiple) fields from a hash.
Returns number of fields deleted.
Redis Docs
Source§fn hget_del<'a, K, F, RV>(
&mut self,
key: K,
fields: F,
) -> Result<RV, RedisError>
fn hget_del<'a, K, F, RV>( &mut self, key: K, fields: F, ) -> Result<RV, RedisError>
Get and delete the value of one or more fields of a given hash key
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hset<'a, K, F, V, RV>(
&mut self,
key: K,
field: F,
value: V,
) -> Result<RV, RedisError>
fn hset<'a, K, F, V, RV>( &mut self, key: K, field: F, value: V, ) -> Result<RV, RedisError>
Sets a single field in a hash.
Returns number of fields added.
Redis Docs
Source§fn hset_ex<'a, K, F, V, RV>(
&mut self,
key: K,
hash_field_expiration_options: &'a HashFieldExpirationOptions,
fields_values: &'a [(F, V)],
) -> Result<RV, RedisError>
fn hset_ex<'a, K, F, V, RV>( &mut self, key: K, hash_field_expiration_options: &'a HashFieldExpirationOptions, fields_values: &'a [(F, V)], ) -> Result<RV, RedisError>
Set the value of one or more fields of a given hash key, and optionally set their expiration
Redis Docs.arg(key).arg(hash_field_expiration_options).arg(“FIELDS)
Source§fn hset_nx<'a, K, F, V, RV>(
&mut self,
key: K,
field: F,
value: V,
) -> Result<RV, RedisError>
fn hset_nx<'a, K, F, V, RV>( &mut self, key: K, field: F, value: V, ) -> Result<RV, RedisError>
Sets a single field in a hash if it does not exist.
Returns whether the field was added.
Redis Docs
Source§fn hset_multiple<'a, K, F, V, RV>(
&mut self,
key: K,
items: &'a [(F, V)],
) -> Result<RV, RedisError>
fn hset_multiple<'a, K, F, V, RV>( &mut self, key: K, items: &'a [(F, V)], ) -> Result<RV, RedisError>
Sets multiple fields in a hash.
Redis Docs
Source§fn hincr<'a, K, F, D, RV>(
&mut self,
key: K,
field: F,
delta: D,
) -> Result<RV, RedisError>
fn hincr<'a, K, F, D, RV>( &mut self, key: K, field: F, delta: D, ) -> Result<RV, RedisError>
Increments a value.
Returns the new value of the field after incrementation.
Source§fn hexists<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
fn hexists<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
Checks if a field in a hash exists.
Redis Docs
Source§fn httl<'a, K, F, RV>(&mut self, key: K, fields: F) -> Result<RV, RedisError>
fn httl<'a, K, F, RV>(&mut self, key: K, fields: F) -> Result<RV, RedisError>
Get one or more fields’ TTL in seconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hpttl<'a, K, F, RV>(&mut self, key: K, fields: F) -> Result<RV, RedisError>
fn hpttl<'a, K, F, RV>(&mut self, key: K, fields: F) -> Result<RV, RedisError>
Get one or more fields’ TTL in milliseconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hexpire<'a, K, F, RV>(
&mut self,
key: K,
seconds: i64,
opt: ExpireOption,
fields: F,
) -> Result<RV, RedisError>
fn hexpire<'a, K, F, RV>( &mut self, key: K, seconds: i64, opt: ExpireOption, fields: F, ) -> Result<RV, RedisError>
Set one or more fields’ time to live in seconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with 0 seconds.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(seconds).arg(opt).arg(“FIELDS)
Source§fn hexpire_at<'a, K, F, RV>(
&mut self,
key: K,
ts: i64,
opt: ExpireOption,
fields: F,
) -> Result<RV, RedisError>
fn hexpire_at<'a, K, F, RV>( &mut self, key: K, ts: i64, opt: ExpireOption, fields: F, ) -> Result<RV, RedisError>
Set the expiration for one or more fields as a UNIX timestamp in milliseconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with a time in the past.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(ts).arg(opt).arg(“FIELDS)
Source§fn hexpire_time<'a, K, F, RV>(
&mut self,
key: K,
fields: F,
) -> Result<RV, RedisError>
fn hexpire_time<'a, K, F, RV>( &mut self, key: K, fields: F, ) -> Result<RV, RedisError>
Returns the absolute Unix expiration timestamp in seconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hpersist<'a, K, F, RV>(
&mut self,
key: K,
fields: F,
) -> Result<RV, RedisError>
fn hpersist<'a, K, F, RV>( &mut self, key: K, fields: F, ) -> Result<RV, RedisError>
Remove the expiration from a key.
Returns 1 if the expiration was removed.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hpexpire<'a, K, F, RV>(
&mut self,
key: K,
milliseconds: i64,
opt: ExpireOption,
fields: F,
) -> Result<RV, RedisError>
fn hpexpire<'a, K, F, RV>( &mut self, key: K, milliseconds: i64, opt: ExpireOption, fields: F, ) -> Result<RV, RedisError>
Set one or more fields’ time to live in milliseconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with 0 seconds.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(milliseconds).arg(opt).arg(“FIELDS)
Source§fn hpexpire_at<'a, K, F, RV>(
&mut self,
key: K,
ts: i64,
opt: ExpireOption,
fields: F,
) -> Result<RV, RedisError>
fn hpexpire_at<'a, K, F, RV>( &mut self, key: K, ts: i64, opt: ExpireOption, fields: F, ) -> Result<RV, RedisError>
Set the expiration for one or more fields as a UNIX timestamp in milliseconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with a time in the past.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(ts).arg(opt).arg(“FIELDS)
Source§fn hpexpire_time<'a, K, F, RV>(
&mut self,
key: K,
fields: F,
) -> Result<RV, RedisError>
fn hpexpire_time<'a, K, F, RV>( &mut self, key: K, fields: F, ) -> Result<RV, RedisError>
Returns the absolute Unix expiration timestamp in seconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hkeys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn hkeys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Gets all the keys in a hash.
Redis Docs
Source§fn hvals<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn hvals<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Gets all the values in a hash.
Redis Docs
Source§fn hgetall<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn hgetall<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Gets all the fields and values in a hash.
Redis Docs
Source§fn hlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn hlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Gets the length of a hash.
Returns 0 if key does not exist.
Redis Docs
Source§fn blmove<'a, S, D, RV>(
&mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
timeout: f64,
) -> Result<RV, RedisError>
fn blmove<'a, S, D, RV>( &mut self, srckey: S, dstkey: D, src_dir: Direction, dst_dir: Direction, timeout: f64, ) -> Result<RV, RedisError>
Pop an element from a list, push it to another list
and return it; or block until one is available
Redis Docs
Source§fn blmpop<'a, K, RV>(
&mut self,
timeout: f64,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn blmpop<'a, K, RV>(
&mut self,
timeout: f64,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Pops
count
elements from the first non-empty list key from the list of
provided key names; or blocks until one is available.
Redis Docs.arg(timeout).arg(numkeys).arg(key).arg(dir).arg(“COUNT)Source§fn blpop<'a, K, RV>(&mut self, key: K, timeout: f64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn blpop<'a, K, RV>(&mut self, key: K, timeout: f64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Remove and get the first element in a list, or block until one is available.
Redis Docs
Source§fn brpop<'a, K, RV>(&mut self, key: K, timeout: f64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn brpop<'a, K, RV>(&mut self, key: K, timeout: f64) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Remove and get the last element in a list, or block until one is available.
Redis Docs
Source§fn brpoplpush<'a, S, D, RV>(
&mut self,
srckey: S,
dstkey: D,
timeout: f64,
) -> Result<RV, RedisError>
fn brpoplpush<'a, S, D, RV>( &mut self, srckey: S, dstkey: D, timeout: f64, ) -> Result<RV, RedisError>
Pop a value from a list, push it to another list and return it;
or block until one is available.
Redis Docs
Source§fn lindex<'a, K, RV>(&mut self, key: K, index: isize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn lindex<'a, K, RV>(&mut self, key: K, index: isize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get an element from a list by its index.
Redis Docs
Source§fn linsert_before<'a, K, P, V, RV>(
&mut self,
key: K,
pivot: P,
value: V,
) -> Result<RV, RedisError>
fn linsert_before<'a, K, P, V, RV>( &mut self, key: K, pivot: P, value: V, ) -> Result<RV, RedisError>
Insert an element before another element in a list.
Redis Docs
Source§fn linsert_after<'a, K, P, V, RV>(
&mut self,
key: K,
pivot: P,
value: V,
) -> Result<RV, RedisError>
fn linsert_after<'a, K, P, V, RV>( &mut self, key: K, pivot: P, value: V, ) -> Result<RV, RedisError>
Insert an element after another element in a list.
Redis Docs
Source§fn llen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn llen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the length of the list stored at key.
Redis Docs
Source§fn lmove<'a, S, D, RV>(
&mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
) -> Result<RV, RedisError>
fn lmove<'a, S, D, RV>( &mut self, srckey: S, dstkey: D, src_dir: Direction, dst_dir: Direction, ) -> Result<RV, RedisError>
Pop an element a list, push it to another list and return it
Redis Docs
Source§fn lmpop<'a, K, RV>(
&mut self,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn lmpop<'a, K, RV>(
&mut self,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Pops
count
elements from the first non-empty list key from the list of
provided key names.
Redis Docs.arg(numkeys).arg(key).arg(dir).arg(“COUNT)Source§fn lpop<'a, K, RV>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn lpop<'a, K, RV>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Removes and returns the up to
count
first elements of the list stored at key. Read moreSource§fn lpos<'a, K, V, RV>(
&mut self,
key: K,
value: V,
options: LposOptions,
) -> Result<RV, RedisError>
fn lpos<'a, K, V, RV>( &mut self, key: K, value: V, options: LposOptions, ) -> Result<RV, RedisError>
Returns the index of the first matching value of the list stored at key.
Redis Docs
Source§fn lpush<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
fn lpush<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
Insert all the specified values at the head of the list stored at key.
Redis Docs
Source§fn lpush_exists<'a, K, V, RV>(
&mut self,
key: K,
value: V,
) -> Result<RV, RedisError>
fn lpush_exists<'a, K, V, RV>( &mut self, key: K, value: V, ) -> Result<RV, RedisError>
Inserts a value at the head of the list stored at key, only if key
already exists and holds a list.
Redis Docs
Source§fn lrange<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn lrange<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the specified elements of the list stored at key.
Redis Docs
Source§fn lrem<'a, K, V, RV>(
&mut self,
key: K,
count: isize,
value: V,
) -> Result<RV, RedisError>
fn lrem<'a, K, V, RV>( &mut self, key: K, count: isize, value: V, ) -> Result<RV, RedisError>
Removes the first count occurrences of elements equal to value
from the list stored at key.
Redis Docs
Source§fn ltrim<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn ltrim<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Trim an existing list so that it will contain only the specified
range of elements specified.
Redis Docs
Source§fn lset<'a, K, V, RV>(
&mut self,
key: K,
index: isize,
value: V,
) -> Result<RV, RedisError>
fn lset<'a, K, V, RV>( &mut self, key: K, index: isize, value: V, ) -> Result<RV, RedisError>
Sets the list element at index to value
Redis Docs
Source§fn ping<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn ping<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Sends a ping to the server
Redis Docs
Source§fn ping_message<'a, K, RV>(&mut self, message: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn ping_message<'a, K, RV>(&mut self, message: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Sends a ping with a message to the server
Redis Docs
Source§fn rpop<'a, K, RV>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn rpop<'a, K, RV>(
&mut self,
key: K,
count: Option<NonZero<usize>>,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Removes and returns the up to
count
last elements of the list stored at key Read moreSource§fn rpoplpush<'a, K, D, RV>(
&mut self,
key: K,
dstkey: D,
) -> Result<RV, RedisError>
fn rpoplpush<'a, K, D, RV>( &mut self, key: K, dstkey: D, ) -> Result<RV, RedisError>
Pop a value from a list, push it to another list and return it.
Redis Docs
Source§fn rpush<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
fn rpush<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
Insert all the specified values at the tail of the list stored at key.
Redis Docs
Source§fn rpush_exists<'a, K, V, RV>(
&mut self,
key: K,
value: V,
) -> Result<RV, RedisError>
fn rpush_exists<'a, K, V, RV>( &mut self, key: K, value: V, ) -> Result<RV, RedisError>
Inserts value at the tail of the list stored at key, only if key
already exists and holds a list.
Redis Docs
Source§fn sadd<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
fn sadd<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
Add one or more members to a set.
Redis Docs
Source§fn scard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn scard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the number of members in a set.
Redis Docs
Source§fn sdiff<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn sdiff<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Subtract multiple sets.
Redis Docs
Source§fn sdiffstore<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn sdiffstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Subtract multiple sets and store the resulting set in a key.
Redis Docs
Source§fn sinter<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn sinter<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Intersect multiple sets.
Redis Docs
Source§fn sinterstore<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn sinterstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Intersect multiple sets and store the resulting set in a key.
Redis Docs
Source§fn sismember<'a, K, M, RV>(
&mut self,
key: K,
member: M,
) -> Result<RV, RedisError>
fn sismember<'a, K, M, RV>( &mut self, key: K, member: M, ) -> Result<RV, RedisError>
Determine if a given value is a member of a set.
Redis Docs
Source§fn smismember<'a, K, M, RV>(
&mut self,
key: K,
members: M,
) -> Result<RV, RedisError>
fn smismember<'a, K, M, RV>( &mut self, key: K, members: M, ) -> Result<RV, RedisError>
Determine if given values are members of a set.
Redis Docs
Source§fn smembers<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn smembers<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get all the members in a set.
Redis Docs
Source§fn smove<'a, S, D, M, RV>(
&mut self,
srckey: S,
dstkey: D,
member: M,
) -> Result<RV, RedisError>
fn smove<'a, S, D, M, RV>( &mut self, srckey: S, dstkey: D, member: M, ) -> Result<RV, RedisError>
Move a member from one set to another.
Redis Docs
Source§fn spop<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn spop<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Remove and return a random member from a set.
Redis Docs
Source§fn srandmember<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn srandmember<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get one random member from a set.
Redis Docs
Source§fn srandmember_multiple<'a, K, RV>(
&mut self,
key: K,
count: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn srandmember_multiple<'a, K, RV>(
&mut self,
key: K,
count: usize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get multiple random members from a set.
Redis Docs
Source§fn srem<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
fn srem<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
Remove one or more members from a set.
Redis Docs
Source§fn sunion<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn sunion<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Add multiple sets.
Redis Docs
Source§fn sunionstore<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn sunionstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Add multiple sets and store the resulting set in a key.
Redis Docs
Source§fn zadd<'a, K, S, M, RV>(
&mut self,
key: K,
member: M,
score: S,
) -> Result<RV, RedisError>
fn zadd<'a, K, S, M, RV>( &mut self, key: K, member: M, score: S, ) -> Result<RV, RedisError>
Add one member to a sorted set, or update its score if it already exists.
Redis Docs
Source§fn zadd_multiple<'a, K, S, M, RV>(
&mut self,
key: K,
items: &'a [(S, M)],
) -> Result<RV, RedisError>
fn zadd_multiple<'a, K, S, M, RV>( &mut self, key: K, items: &'a [(S, M)], ) -> Result<RV, RedisError>
Add multiple members to a sorted set, or update its score if it already exists.
Redis Docs
Source§fn zcard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zcard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Get the number of members in a sorted set.
Redis Docs
Source§fn zcount<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zcount<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Count the members in a sorted set with scores within the given values.
Redis Docs
Source§fn zincr<'a, K, M, D, RV>(
&mut self,
key: K,
member: M,
delta: D,
) -> Result<RV, RedisError>
fn zincr<'a, K, M, D, RV>( &mut self, key: K, member: M, delta: D, ) -> Result<RV, RedisError>
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.
Redis Docs
Source§fn zinterstore<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn zinterstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Intersect multiple sorted sets and store the resulting sorted set in
a new key using SUM as aggregation function.
Redis Docs
Source§fn zinterstore_min<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn zinterstore_min<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Intersect multiple sorted sets and store the resulting sorted set in
a new key using MIN as aggregation function.
Redis Docs
Source§fn zinterstore_max<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn zinterstore_max<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Intersect multiple sorted sets and store the resulting sorted set in
a new key using MAX as aggregation function.
Redis Docs
Source§fn zinterstore_weights<'a, D, K, W, RV>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<RV, RedisError>
fn zinterstore_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<RV, RedisError>
Commands::zinterstore
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Redis DocsSource§fn zinterstore_min_weights<'a, D, K, W, RV>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<RV, RedisError>
fn zinterstore_min_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<RV, RedisError>
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.
Redis DocsSource§fn zinterstore_max_weights<'a, D, K, W, RV>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<RV, RedisError>
fn zinterstore_max_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<RV, RedisError>
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.
Redis DocsSource§fn zlexcount<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zlexcount<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Count the number of members in a sorted set between a given lexicographical range.
Redis Docs
Source§fn bzpopmax<'a, K, RV>(
&mut self,
key: K,
timeout: f64,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn bzpopmax<'a, K, RV>(
&mut self,
key: K,
timeout: f64,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Removes and returns the member with the highest score in a sorted set.
Blocks until a member is available otherwise.
Redis Docs
Source§fn zpopmax<'a, K, RV>(&mut self, key: K, count: isize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zpopmax<'a, K, RV>(&mut self, key: K, count: isize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Removes and returns up to count members with the highest scores in a sorted set
Redis Docs
Source§fn bzpopmin<'a, K, RV>(
&mut self,
key: K,
timeout: f64,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn bzpopmin<'a, K, RV>(
&mut self,
key: K,
timeout: f64,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Removes and returns the member with the lowest score in a sorted set.
Blocks until a member is available otherwise.
Redis Docs
Source§fn zpopmin<'a, K, RV>(&mut self, key: K, count: isize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zpopmin<'a, K, RV>(&mut self, key: K, count: isize) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Removes and returns up to count members with the lowest scores in a sorted set
Redis Docs
Source§fn bzmpop_max<'a, K, RV>(
&mut self,
timeout: f64,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn bzmpop_max<'a, K, RV>(
&mut self,
timeout: f64,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
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.
Redis Docs
Source§fn zmpop_max<'a, K, RV>(
&mut self,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zmpop_max<'a, K, RV>(
&mut self,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
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.
Redis Docs
Source§fn bzmpop_min<'a, K, RV>(
&mut self,
timeout: f64,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn bzmpop_min<'a, K, RV>(
&mut self,
timeout: f64,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
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.
Redis Docs
Source§fn zmpop_min<'a, K, RV>(
&mut self,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zmpop_min<'a, K, RV>(
&mut self,
keys: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
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.
Redis Docs
Source§fn zrandmember<'a, K, RV>(
&mut self,
key: K,
count: Option<isize>,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zrandmember<'a, K, RV>(
&mut self,
key: K,
count: Option<isize>,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return up to count random members in a sorted set (or 1 if
count == None
)
Redis DocsSource§fn zrandmember_withscores<'a, K, RV>(
&mut self,
key: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zrandmember_withscores<'a, K, RV>(
&mut self,
key: K,
count: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return up to count random members in a sorted set with scores
Redis Docs
Source§fn zrange<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zrange<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return a range of members in a sorted set, by index
Redis Docs
Source§fn zrange_withscores<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zrange_withscores<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return a range of members in a sorted set, by index with scores.
Redis Docs
Source§fn zrangebylex<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zrangebylex<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by lexicographical range.
Redis Docs
Source§fn zrangebylex_limit<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<RV, RedisError>
fn zrangebylex_limit<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by lexicographical
range with offset and limit.
Redis Docs
Source§fn zrevrangebylex<'a, K, MM, M, RV>(
&mut self,
key: K,
max: MM,
min: M,
) -> Result<RV, RedisError>
fn zrevrangebylex<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by lexicographical range.
Redis Docs
Source§fn zrevrangebylex_limit<'a, K, MM, M, RV>(
&mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<RV, RedisError>
fn zrevrangebylex_limit<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by lexicographical
range with offset and limit.
Redis Docs
Source§fn zrangebyscore<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zrangebyscore<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score.
Redis Docs
Source§fn zrangebyscore_withscores<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zrangebyscore_withscores<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score with scores.
Redis Docs
Source§fn zrangebyscore_limit<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<RV, RedisError>
fn zrangebyscore_limit<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score with limit.
Redis Docs
Source§fn zrangebyscore_limit_withscores<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<RV, RedisError>
fn zrangebyscore_limit_withscores<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score with limit with scores.
Redis Docs
Source§fn zrank<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
fn zrank<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
Determine the index of a member in a sorted set.
Redis Docs
Source§fn zrem<'a, K, M, RV>(&mut self, key: K, members: M) -> Result<RV, RedisError>
fn zrem<'a, K, M, RV>(&mut self, key: K, members: M) -> Result<RV, RedisError>
Remove one or more members from a sorted set.
Redis Docs
Source§fn zrembylex<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zrembylex<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Remove all members in a sorted set between the given lexicographical range.
Redis Docs
Source§fn zremrangebyrank<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zremrangebyrank<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Remove all members in a sorted set within the given indexes.
Redis Docs
Source§fn zrembyscore<'a, K, M, MM, RV>(
&mut self,
key: K,
min: M,
max: MM,
) -> Result<RV, RedisError>
fn zrembyscore<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, ) -> Result<RV, RedisError>
Remove all members in a sorted set within the given scores.
Redis Docs
Source§fn zrevrange<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zrevrange<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return a range of members in a sorted set, by index,
ordered from high to low.
Redis Docs
Source§fn zrevrange_withscores<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zrevrange_withscores<'a, K, RV>(
&mut self,
key: K,
start: isize,
stop: isize,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return a range of members in a sorted set, by index, with scores
ordered from high to low.
Redis Docs
Source§fn zrevrangebyscore<'a, K, MM, M, RV>(
&mut self,
key: K,
max: MM,
min: M,
) -> Result<RV, RedisError>
fn zrevrangebyscore<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score.
Redis Docs
Source§fn zrevrangebyscore_withscores<'a, K, MM, M, RV>(
&mut self,
key: K,
max: MM,
min: M,
) -> Result<RV, RedisError>
fn zrevrangebyscore_withscores<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score with scores.
Redis Docs
Source§fn zrevrangebyscore_limit<'a, K, MM, M, RV>(
&mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<RV, RedisError>
fn zrevrangebyscore_limit<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score with limit.
Redis Docs
Source§fn zrevrangebyscore_limit_withscores<'a, K, MM, M, RV>(
&mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<RV, RedisError>
fn zrevrangebyscore_limit_withscores<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize, ) -> Result<RV, RedisError>
Return a range of members in a sorted set, by score with limit with scores.
Redis Docs
Source§fn zrevrank<'a, K, M, RV>(
&mut self,
key: K,
member: M,
) -> Result<RV, RedisError>
fn zrevrank<'a, K, M, RV>( &mut self, key: K, member: M, ) -> Result<RV, RedisError>
Determine the index of a member in a sorted set, with scores ordered from high to low.
Redis Docs
Source§fn zscore<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
fn zscore<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
Get the score associated with the given member in a sorted set.
Redis Docs
Source§fn zscore_multiple<'a, K, M, RV>(
&mut self,
key: K,
members: &'a [M],
) -> Result<RV, RedisError>
fn zscore_multiple<'a, K, M, RV>( &mut self, key: K, members: &'a [M], ) -> Result<RV, RedisError>
Get the scores associated with multiple members in a sorted set.
Redis Docs
Source§fn zunionstore<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn zunionstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Unions multiple sorted sets and store the resulting sorted set in
a new key using SUM as aggregation function.
Redis Docs
Source§fn zunionstore_min<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn zunionstore_min<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Unions multiple sorted sets and store the resulting sorted set in
a new key using MIN as aggregation function.
Redis Docs
Source§fn zunionstore_max<'a, D, K, RV>(
&mut self,
dstkey: D,
keys: K,
) -> Result<RV, RedisError>
fn zunionstore_max<'a, D, K, RV>( &mut self, dstkey: D, keys: K, ) -> Result<RV, RedisError>
Unions multiple sorted sets and store the resulting sorted set in
a new key using MAX as aggregation function.
Redis Docs
Source§fn zunionstore_weights<'a, D, K, W, RV>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<RV, RedisError>
fn zunionstore_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<RV, RedisError>
Commands::zunionstore
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Redis DocsSource§fn zunionstore_min_weights<'a, D, K, W, RV>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<RV, RedisError>
fn zunionstore_min_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<RV, RedisError>
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.
Redis DocsSource§fn zunionstore_max_weights<'a, D, K, W, RV>(
&mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<RV, RedisError>
fn zunionstore_max_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<RV, RedisError>
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.
Redis DocsSource§fn pfadd<'a, K, E, RV>(&mut self, key: K, element: E) -> Result<RV, RedisError>
fn pfadd<'a, K, E, RV>(&mut self, key: K, element: E) -> Result<RV, RedisError>
Adds the specified elements to the specified HyperLogLog.
Redis Docs
Source§fn pfcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn pfcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Return the approximated cardinality of the set(s) observed by the
HyperLogLog at key(s).
Redis Docs
Source§fn pfmerge<'a, D, S, RV>(
&mut self,
dstkey: D,
srckeys: S,
) -> Result<RV, RedisError>
fn pfmerge<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>
Merge N different HyperLogLogs into a single one.
Redis Docs
Source§fn publish<'a, K, E, RV>(
&mut self,
channel: K,
message: E,
) -> Result<RV, RedisError>
fn publish<'a, K, E, RV>( &mut self, channel: K, message: E, ) -> Result<RV, RedisError>
Posts a message to the given channel.
Redis Docs
Source§fn spublish<'a, K, E, RV>(
&mut self,
channel: K,
message: E,
) -> Result<RV, RedisError>
fn spublish<'a, K, E, RV>( &mut self, channel: K, message: E, ) -> Result<RV, RedisError>
Posts a message to the given sharded channel.
Redis Docs
Source§fn object_encoding<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn object_encoding<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the encoding of a key.
Redis Docs
Source§fn object_idletime<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn object_idletime<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the time in seconds since the last access of a key.
Redis Docs
Source§fn object_freq<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn object_freq<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the logarithmic access frequency counter of a key.
Redis Docs
Source§fn object_refcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn object_refcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the reference count of a key.
Redis Docs
Source§fn client_getname<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn client_getname<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Returns the name of the current connection as set by CLIENT SETNAME.
Redis Docs
Source§fn client_id<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn client_id<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Returns the ID of the current connection.
Redis Docs
Source§fn client_setname<'a, K, RV>(
&mut self,
connection_name: K,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn client_setname<'a, K, RV>(
&mut self,
connection_name: K,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Command assigns a name to the current connection.
Redis Docs
Source§fn acl_load<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_load<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
When Redis is configured to use an ACL file (with the aclfile
configuration option), this command will reload the ACLs from the file,
replacing all the current ACL rules with the ones defined in the file.
Redis Docs
Source§fn acl_save<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_save<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
When Redis is configured to use an ACL file (with the aclfile
configuration option), this command will save the currently defined
ACLs from the server memory to the ACL file.
Redis Docs
Source§fn acl_list<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_list<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Shows the currently active ACL rules in the Redis server.
Redis Docs
Source§fn acl_users<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_users<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Shows a list of all the usernames of the currently configured users in
the Redis ACL system.
Redis Docs
Source§fn acl_getuser<'a, K, RV>(&mut self, username: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn acl_getuser<'a, K, RV>(&mut self, username: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns all the rules defined for an existing ACL user.
Redis Docs
Source§fn acl_setuser<'a, K, RV>(&mut self, username: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn acl_setuser<'a, K, RV>(&mut self, username: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Creates an ACL user without any privilege.
Redis Docs
Source§fn acl_setuser_rules<'a, K, RV>(
&mut self,
username: K,
rules: &'a [Rule],
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn acl_setuser_rules<'a, K, RV>(
&mut self,
username: K,
rules: &'a [Rule],
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Creates an ACL user with the specified rules or modify the rules of
an existing user.
Redis Docs
Source§fn acl_deluser<'a, K, RV>(
&mut self,
usernames: &'a [K],
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn acl_deluser<'a, K, RV>(
&mut self,
usernames: &'a [K],
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Delete all the specified ACL users and terminate all the connections
that are authenticated with such users.
Redis Docs
Source§fn acl_dryrun<'a, K, C, A, RV>(
&mut self,
username: K,
command: C,
args: A,
) -> Result<RV, RedisError>
fn acl_dryrun<'a, K, C, A, RV>( &mut self, username: K, command: C, args: A, ) -> Result<RV, RedisError>
Simulate the execution of a given command by a given user.
Redis Docs
Source§fn acl_cat<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_cat<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Shows the available ACL categories.
Redis Docs
Source§fn acl_cat_categoryname<'a, K, RV>(
&mut self,
categoryname: K,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn acl_cat_categoryname<'a, K, RV>(
&mut self,
categoryname: K,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Shows all the Redis commands in the specified category.
Redis Docs
Source§fn acl_genpass<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_genpass<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Generates a 256-bits password starting from /dev/urandom if available.
Redis Docs
Source§fn acl_genpass_bits<'a, RV>(&mut self, bits: isize) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_genpass_bits<'a, RV>(&mut self, bits: isize) -> Result<RV, RedisError>where
RV: FromRedisValue,
Generates a 1-to-1024-bits password starting from /dev/urandom if available.
Redis Docs
Source§fn acl_whoami<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_whoami<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Returns the username the current connection is authenticated with.
Redis Docs
Source§fn acl_log<'a, RV>(&mut self, count: isize) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_log<'a, RV>(&mut self, count: isize) -> Result<RV, RedisError>where
RV: FromRedisValue,
Shows a list of recent ACL security events
Redis Docs
Source§fn acl_log_reset<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_log_reset<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Clears the ACL log.
Redis Docs
Source§fn acl_help<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn acl_help<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Returns a helpful text describing the different subcommands.
Redis Docs
Source§fn geo_add<'a, K, M, RV>(
&mut self,
key: K,
members: M,
) -> Result<RV, RedisError>
fn geo_add<'a, K, M, RV>( &mut self, key: K, members: M, ) -> Result<RV, RedisError>
Adds the specified geospatial items to the specified key. Read more
Source§fn geo_dist<'a, K, M1, M2, RV>(
&mut self,
key: K,
member1: M1,
member2: M2,
unit: Unit,
) -> Result<RV, RedisError>
fn geo_dist<'a, K, M1, M2, RV>( &mut self, key: K, member1: M1, member2: M2, unit: Unit, ) -> Result<RV, RedisError>
Return the distance between two members in the geospatial index
represented by the sorted set. Read more
Source§fn geo_hash<'a, K, M, RV>(
&mut self,
key: K,
members: M,
) -> Result<RV, RedisError>
fn geo_hash<'a, K, M, RV>( &mut self, key: K, members: M, ) -> Result<RV, RedisError>
Source§fn geo_pos<'a, K, M, RV>(
&mut self,
key: K,
members: M,
) -> Result<RV, RedisError>
fn geo_pos<'a, K, M, RV>( &mut self, key: K, members: M, ) -> Result<RV, RedisError>
Return the positions of all the specified members of the geospatial
index represented by the sorted set at key. Read more
Source§fn geo_radius<'a, K, RV>(
&mut self,
key: K,
longitude: f64,
latitude: f64,
radius: f64,
unit: Unit,
options: RadiusOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn geo_radius<'a, K, RV>(
&mut self,
key: K,
longitude: f64,
latitude: f64,
radius: f64,
unit: Unit,
options: RadiusOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Source§fn geo_radius_by_member<'a, K, M, RV>(
&mut self,
key: K,
member: M,
radius: f64,
unit: Unit,
options: RadiusOptions,
) -> Result<RV, RedisError>
fn geo_radius_by_member<'a, K, M, RV>( &mut self, key: K, member: M, radius: f64, unit: Unit, options: RadiusOptions, ) -> Result<RV, RedisError>
Retrieve members selected by distance with the center of
member
. The
member itself is always contained in the results.
Redis DocsSource§fn xack<'a, K, G, I, RV>(
&mut self,
key: K,
group: G,
ids: &'a [I],
) -> Result<RV, RedisError>
fn xack<'a, K, G, I, RV>( &mut self, key: K, group: G, ids: &'a [I], ) -> Result<RV, RedisError>
Ack pending stream messages checked out by a consumer. Read more
Source§fn xadd<'a, K, ID, F, V, RV>(
&mut self,
key: K,
id: ID,
items: &'a [(F, V)],
) -> Result<RV, RedisError>
fn xadd<'a, K, ID, F, V, RV>( &mut self, key: K, id: ID, items: &'a [(F, V)], ) -> Result<RV, RedisError>
Source§fn xadd_map<'a, K, ID, BTM, RV>(
&mut self,
key: K,
id: ID,
map: BTM,
) -> Result<RV, RedisError>
fn xadd_map<'a, K, ID, BTM, RV>( &mut self, key: K, id: ID, map: BTM, ) -> Result<RV, RedisError>
BTreeMap variant for adding a stream message by
key
.
Use *
as the id
for the current timestamp. Read moreSource§fn xadd_options<'a, K, ID, I, RV>(
&mut self,
key: K,
id: ID,
items: I,
options: &'a StreamAddOptions,
) -> Result<RV, RedisError>
fn xadd_options<'a, K, ID, I, RV>( &mut self, key: K, id: ID, items: I, options: &'a StreamAddOptions, ) -> Result<RV, RedisError>
Add a stream message with options. Read more
Source§fn xadd_maxlen<'a, K, ID, F, V, RV>(
&mut self,
key: K,
maxlen: StreamMaxlen,
id: ID,
items: &'a [(F, V)],
) -> Result<RV, RedisError>
fn xadd_maxlen<'a, K, ID, F, V, RV>( &mut self, key: K, maxlen: StreamMaxlen, id: ID, items: &'a [(F, V)], ) -> Result<RV, RedisError>
Add a stream message while capping the stream at a maxlength. Read more
Source§fn xadd_maxlen_map<'a, K, ID, BTM, RV>(
&mut self,
key: K,
maxlen: StreamMaxlen,
id: ID,
map: BTM,
) -> Result<RV, RedisError>
fn xadd_maxlen_map<'a, K, ID, BTM, RV>( &mut self, key: K, maxlen: StreamMaxlen, id: ID, map: BTM, ) -> Result<RV, RedisError>
BTreeMap variant for adding a stream message while capping the stream at a maxlength. Read more
Source§fn xautoclaim_options<'a, K, G, C, MIT, S, RV>(
&mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
start: S,
options: StreamAutoClaimOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
C: ToRedisArgs,
MIT: ToRedisArgs,
S: ToRedisArgs,
RV: FromRedisValue,
fn xautoclaim_options<'a, K, G, C, MIT, S, RV>(
&mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
start: S,
options: StreamAutoClaimOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
C: ToRedisArgs,
MIT: ToRedisArgs,
S: ToRedisArgs,
RV: FromRedisValue,
Perform a combined xpending and xclaim flow. Read more
Source§fn xclaim<'a, K, G, C, MIT, ID, RV>(
&mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
C: ToRedisArgs,
MIT: ToRedisArgs,
ID: ToRedisArgs,
RV: FromRedisValue,
fn xclaim<'a, K, G, C, MIT, ID, RV>(
&mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
C: ToRedisArgs,
MIT: ToRedisArgs,
ID: ToRedisArgs,
RV: FromRedisValue,
Claim pending, unacked messages, after some period of time,
currently checked out by another consumer. Read more
Source§fn xclaim_options<'a, K, G, C, MIT, ID, RV>(
&mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
options: StreamClaimOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
C: ToRedisArgs,
MIT: ToRedisArgs,
ID: ToRedisArgs,
RV: FromRedisValue,
fn xclaim_options<'a, K, G, C, MIT, ID, RV>(
&mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
options: StreamClaimOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
C: ToRedisArgs,
MIT: ToRedisArgs,
ID: ToRedisArgs,
RV: FromRedisValue,
This is the optional arguments version for claiming unacked, pending messages
currently checked out by another consumer. Read more
Source§fn xgroup_create<'a, K, G, ID, RV>(
&mut self,
key: K,
group: G,
id: ID,
) -> Result<RV, RedisError>
fn xgroup_create<'a, K, G, ID, RV>( &mut self, key: K, group: G, id: ID, ) -> Result<RV, RedisError>
This command is used for creating a consumer
group
. It expects the stream key
to already exist. Otherwise, use xgroup_create_mkstream
if it doesn’t.
The id
is the starting message id all consumers should read from. Use $
If you want
all consumers to read from the last message added to stream. Read moreSource§fn xgroup_createconsumer<'a, K, G, C, RV>(
&mut self,
key: K,
group: G,
consumer: C,
) -> Result<RV, RedisError>
fn xgroup_createconsumer<'a, K, G, C, RV>( &mut self, key: K, group: G, consumer: C, ) -> Result<RV, RedisError>
This creates a
consumer
explicitly (vs implicit via XREADGROUP)
for given stream `key. Read moreSource§fn xgroup_create_mkstream<'a, K, G, ID, RV>(
&mut self,
key: K,
group: G,
id: ID,
) -> Result<RV, RedisError>
fn xgroup_create_mkstream<'a, K, G, ID, RV>( &mut self, key: K, group: G, id: ID, ) -> Result<RV, RedisError>
This is the alternate version for creating a consumer
group
which makes the stream if it doesn’t exist. Read moreSource§fn xgroup_setid<'a, K, G, ID, RV>(
&mut self,
key: K,
group: G,
id: ID,
) -> Result<RV, RedisError>
fn xgroup_setid<'a, K, G, ID, RV>( &mut self, key: K, group: G, id: ID, ) -> Result<RV, RedisError>
Source§fn xgroup_destroy<'a, K, G, RV>(
&mut self,
key: K,
group: G,
) -> Result<RV, RedisError>
fn xgroup_destroy<'a, K, G, RV>( &mut self, key: K, group: G, ) -> Result<RV, RedisError>
Source§fn xgroup_delconsumer<'a, K, G, C, RV>(
&mut self,
key: K,
group: G,
consumer: C,
) -> Result<RV, RedisError>
fn xgroup_delconsumer<'a, K, G, C, RV>( &mut self, key: K, group: G, consumer: C, ) -> Result<RV, RedisError>
Source§fn xinfo_consumers<'a, K, G, RV>(
&mut self,
key: K,
group: G,
) -> Result<RV, RedisError>
fn xinfo_consumers<'a, K, G, RV>( &mut self, key: K, group: G, ) -> Result<RV, RedisError>
This returns all info details about
which consumers have read messages for given consumer
group
.
Take note of the StreamInfoConsumersReply return type. Read moreSource§fn xinfo_groups<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xinfo_groups<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns all consumer
group
s created for a given stream key
.
Take note of the StreamInfoGroupsReply return type. Read moreSource§fn xinfo_stream<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xinfo_stream<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns info about high-level stream details
(first & last message
id
, length, number of groups, etc.)
Take note of the StreamInfoStreamReply return type. Read moreSource§fn xlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Returns the number of messages for a given stream
key
. Read moreSource§fn xpending<'a, K, G, RV>(&mut self, key: K, group: G) -> Result<RV, RedisError>
fn xpending<'a, K, G, RV>(&mut self, key: K, group: G) -> Result<RV, RedisError>
This is a basic version of making XPENDING command calls which only
passes a stream
key
and consumer group
and it
returns details about which consumers have pending messages
that haven’t been acked. Read moreSource§fn xpending_count<'a, K, G, S, E, C, RV>(
&mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
S: ToRedisArgs,
E: ToRedisArgs,
C: ToRedisArgs,
RV: FromRedisValue,
fn xpending_count<'a, K, G, S, E, C, RV>(
&mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
S: ToRedisArgs,
E: ToRedisArgs,
C: ToRedisArgs,
RV: FromRedisValue,
This XPENDING version returns a list of all messages over the range.
You can use this for paginating pending messages (but without the message HashMap). Read more
Source§fn xpending_consumer_count<'a, K, G, S, E, C, CN, RV>(
&mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
consumer: CN,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
S: ToRedisArgs,
E: ToRedisArgs,
C: ToRedisArgs,
CN: ToRedisArgs,
RV: FromRedisValue,
fn xpending_consumer_count<'a, K, G, S, E, C, CN, RV>(
&mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
consumer: CN,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
G: ToRedisArgs,
S: ToRedisArgs,
E: ToRedisArgs,
C: ToRedisArgs,
CN: ToRedisArgs,
RV: FromRedisValue,
Source§fn xrange<'a, K, S, E, RV>(
&mut self,
key: K,
start: S,
end: E,
) -> Result<RV, RedisError>
fn xrange<'a, K, S, E, RV>( &mut self, key: K, start: S, end: E, ) -> Result<RV, RedisError>
Returns a range of messages in a given stream
key
. Read moreSource§fn xrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
A helper method for automatically returning all messages in a stream by
key
.
Use with caution! Read moreSource§fn xrange_count<'a, K, S, E, C, RV>(
&mut self,
key: K,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>
fn xrange_count<'a, K, S, E, C, RV>( &mut self, key: K, start: S, end: E, count: C, ) -> Result<RV, RedisError>
A method for paginating a stream by
key
. Read moreSource§fn xread<'a, K, ID, RV>(
&mut self,
keys: &'a [K],
ids: &'a [ID],
) -> Result<RV, RedisError>
fn xread<'a, K, ID, RV>( &mut self, keys: &'a [K], ids: &'a [ID], ) -> Result<RV, RedisError>
Read a list of
id
s for each stream key
.
This is the basic form of reading streams.
For more advanced control, like blocking, limiting, or reading by consumer group
,
see xread_options
. Read moreSource§fn xread_options<'a, K, ID, RV>(
&mut self,
keys: &'a [K],
ids: &'a [ID],
options: &'a StreamReadOptions,
) -> Result<RV, RedisError>
fn xread_options<'a, K, ID, RV>( &mut self, keys: &'a [K], ids: &'a [ID], options: &'a StreamReadOptions, ) -> Result<RV, RedisError>
Source§fn xrevrange<'a, K, E, S, RV>(
&mut self,
key: K,
end: E,
start: S,
) -> Result<RV, RedisError>
fn xrevrange<'a, K, E, S, RV>( &mut self, key: K, end: E, start: S, ) -> Result<RV, RedisError>
Source§fn xrevrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xrevrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Source§fn xrevrange_count<'a, K, E, S, C, RV>(
&mut self,
key: K,
end: E,
start: S,
count: C,
) -> Result<RV, RedisError>
fn xrevrange_count<'a, K, E, S, C, RV>( &mut self, key: K, end: E, start: S, count: C, ) -> Result<RV, RedisError>
Source§fn xtrim<'a, K, RV>(
&mut self,
key: K,
maxlen: StreamMaxlen,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xtrim<'a, K, RV>(
&mut self,
key: K,
maxlen: StreamMaxlen,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Trim a stream
key
to a MAXLEN count. Read moreSource§fn xtrim_options<'a, K, RV>(
&mut self,
key: K,
options: &'a StreamTrimOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn xtrim_options<'a, K, RV>(
&mut self,
key: K,
options: &'a StreamTrimOptions,
) -> Result<RV, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Trim a stream
key
with full options Read moreSource§fn invoke_script<'a, RV>(
&mut self,
invocation: &'a ScriptInvocation<'a>,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn invoke_script<'a, RV>(
&mut self,
invocation: &'a ScriptInvocation<'a>,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
Adds a prepared script command to the pipeline. Read more
Source§fn flushall<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn flushall<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Deletes all the keys of all databases Read more
Source§fn flushall_options<'a, RV>(
&mut self,
options: &'a FlushAllOptions,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn flushall_options<'a, RV>(
&mut self,
options: &'a FlushAllOptions,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
Deletes all the keys of all databases with options Read more
Source§fn flushdb<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn flushdb<'a, RV>(&mut self) -> Result<RV, RedisError>where
RV: FromRedisValue,
Deletes all the keys of the current database Read more
Source§fn flushdb_options<'a, RV>(
&mut self,
options: &'a FlushAllOptions,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn flushdb_options<'a, RV>(
&mut self,
options: &'a FlushAllOptions,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
Deletes all the keys of the current database with options Read more
Source§fn scan<RV>(&mut self) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
fn scan<RV>(&mut self) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
Incrementally iterate the keys space.
Source§fn scan_options<RV>(
&mut self,
opts: ScanOptions,
) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
fn scan_options<RV>(
&mut self,
opts: ScanOptions,
) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
Incrementally iterate the keys space with options.
Source§fn scan_match<P, RV>(&mut self, pattern: P) -> Result<Iter<'_, RV>, RedisError>where
P: ToRedisArgs,
RV: FromRedisValue,
fn scan_match<P, RV>(&mut self, pattern: P) -> Result<Iter<'_, RV>, RedisError>where
P: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate the keys space for keys matching a pattern.
Source§fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate hash fields and associated values.
Source§fn hscan_match<K, P, RV>(
&mut self,
key: K,
pattern: P,
) -> Result<Iter<'_, RV>, RedisError>
fn hscan_match<K, P, RV>( &mut self, key: K, pattern: P, ) -> Result<Iter<'_, RV>, RedisError>
Incrementally iterate hash fields and associated values for
field names matching a pattern.
Source§fn sscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn sscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate set elements.
Source§fn sscan_match<K, P, RV>(
&mut self,
key: K,
pattern: P,
) -> Result<Iter<'_, RV>, RedisError>
fn sscan_match<K, P, RV>( &mut self, key: K, pattern: P, ) -> Result<Iter<'_, RV>, RedisError>
Incrementally iterate set elements for elements matching a pattern.
Source§fn zscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate sorted set elements.
Source§fn zscan_match<K, P, RV>(
&mut self,
key: K,
pattern: P,
) -> Result<Iter<'_, RV>, RedisError>
fn zscan_match<K, P, RV>( &mut self, key: K, pattern: P, ) -> Result<Iter<'_, RV>, RedisError>
Incrementally iterate sorted set elements for elements matching a pattern.
Source§impl<C, T> ConnectionLike for Twhere
C: ConnectionLike,
T: DerefMut<Target = C>,
impl<C, T> ConnectionLike for Twhere
C: ConnectionLike,
T: DerefMut<Target = C>,
Source§fn req_packed_command(&mut self, cmd: &[u8]) -> Result<Value, RedisError>
fn req_packed_command(&mut self, cmd: &[u8]) -> Result<Value, RedisError>
Sends an already encoded (packed) command into the TCP socket and
reads the single response from it.
fn req_packed_commands( &mut self, cmd: &[u8], offset: usize, count: usize, ) -> Result<Vec<Value>, RedisError>
Source§fn req_command(&mut self, cmd: &Cmd) -> Result<Value, RedisError>
fn req_command(&mut self, cmd: &Cmd) -> Result<Value, RedisError>
Sends a Cmd into the TCP socket and reads a single response from it.
Source§fn get_db(&self) -> i64
fn get_db(&self) -> i64
Returns the database this connection is bound to. Note that this
information might be unreliable because it’s initially cached and
also might be incorrect if the connection like object is not
actually connected.
fn supports_pipelining(&self) -> bool
Source§fn check_connection(&mut self) -> bool
fn check_connection(&mut self) -> bool
Check that all connections it has are available (
PING
internally).Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load
.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> 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>
Converts
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>
Converts
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform
distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p
of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator
of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
👎Deprecated since 0.9.0: Renamed to
random
to avoid conflict with the new gen
keyword in Rust 2024.Alias for
Rng::random
.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
👎Deprecated since 0.9.0: Renamed to
random_range
Alias for
Rng::random_range
.Source§impl<C> SignWithKey<String> for Cwhere
C: ToBase64,
impl<C> SignWithKey<String> for Cwhere
C: ToBase64,
fn sign_with_key(self, key: &impl SigningAlgorithm) -> Result<String, Error>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32
.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64
.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest
entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut
wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
Convert an
RngCore
to a RngReadAdapter
.Source§impl<T> TypedCommands for Twhere
T: ConnectionLike,
impl<T> TypedCommands for Twhere
T: ConnectionLike,
Source§fn get<'a, K>(&'a mut self, key: K) -> Result<Option<String>, RedisError>
fn get<'a, K>(&'a mut self, key: K) -> Result<Option<String>, RedisError>
Get the value of a key. If key is a vec this becomes an
MGET
(if using TypedCommands
, you should specifically use mget
to get the correct return type.
Redis DocsSource§fn mget<'a, K>(&'a mut self, key: K) -> Result<Vec<Option<String>>, RedisError>
fn mget<'a, K>(&'a mut self, key: K) -> Result<Vec<Option<String>>, RedisError>
Get values of keys
Redis Docs
Source§fn keys<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
fn keys<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
Gets all keys matching pattern
Redis Docs
Source§fn set<'a, K, V>(&'a mut self, key: K, value: V) -> Result<(), RedisError>
fn set<'a, K, V>(&'a mut self, key: K, value: V) -> Result<(), RedisError>
Set the string value of a key.
Redis Docs
Source§fn set_options<'a, K, V>(
&'a mut self,
key: K,
value: V,
options: SetOptions,
) -> Result<Option<String>, RedisError>
fn set_options<'a, K, V>( &'a mut self, key: K, value: V, options: SetOptions, ) -> Result<Option<String>, RedisError>
Set the string value of a key with options.
Redis Docs
Source§fn set_multiple<'a, K, V>(
&'a mut self,
items: &'a [(K, V)],
) -> Result<(), RedisError>
fn set_multiple<'a, K, V>( &'a mut self, items: &'a [(K, V)], ) -> Result<(), RedisError>
👎Deprecated since 0.22.4: Renamed to mset() to reflect Redis name
Sets multiple keys to their values.
Redis Docs
Source§fn mset<'a, K, V>(&'a mut self, items: &'a [(K, V)]) -> Result<(), RedisError>
fn mset<'a, K, V>(&'a mut self, items: &'a [(K, V)]) -> Result<(), RedisError>
Sets multiple keys to their values.
Redis Docs
Source§fn set_ex<'a, K, V>(
&'a mut self,
key: K,
value: V,
seconds: u64,
) -> Result<(), RedisError>
fn set_ex<'a, K, V>( &'a mut self, key: K, value: V, seconds: u64, ) -> Result<(), RedisError>
Set the value and expiration of a key.
Redis Docs
Source§fn pset_ex<'a, K, V>(
&'a mut self,
key: K,
value: V,
milliseconds: u64,
) -> Result<(), RedisError>
fn pset_ex<'a, K, V>( &'a mut self, key: K, value: V, milliseconds: u64, ) -> Result<(), RedisError>
Set the value and expiration in milliseconds of a key.
Redis Docs
Source§fn set_nx<'a, K, V>(&'a mut self, key: K, value: V) -> Result<bool, RedisError>
fn set_nx<'a, K, V>(&'a mut self, key: K, value: V) -> Result<bool, RedisError>
Set the value of a key, only if the key does not exist
Redis Docs
Source§fn mset_nx<'a, K, V>(
&'a mut self,
items: &'a [(K, V)],
) -> Result<bool, RedisError>
fn mset_nx<'a, K, V>( &'a mut self, items: &'a [(K, V)], ) -> Result<bool, RedisError>
Sets multiple keys to their values failing if at least one already exists.
Redis Docs
Source§fn getset<'a, K, V>(
&'a mut self,
key: K,
value: V,
) -> Result<Option<String>, RedisError>
fn getset<'a, K, V>( &'a mut self, key: K, value: V, ) -> Result<Option<String>, RedisError>
Set the string value of a key and return its old value.
Redis Docs
Source§fn getrange<'a, K>(
&'a mut self,
key: K,
from: isize,
to: isize,
) -> Result<String, RedisError>
fn getrange<'a, K>( &'a mut self, key: K, from: isize, to: isize, ) -> Result<String, RedisError>
Get a range of bytes/substring from the value of a key. Negative values provide an offset from the end of the value.
Redis returns an empty string if the key doesn’t exist, not Nil
Redis Docs
Source§fn setrange<'a, K, V>(
&'a mut self,
key: K,
offset: isize,
value: V,
) -> Result<usize, RedisError>
fn setrange<'a, K, V>( &'a mut self, key: K, offset: isize, value: V, ) -> Result<usize, RedisError>
Overwrite the part of the value stored in key at the specified offset.
Redis Docs
Source§fn del<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn del<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Delete one or more keys.
Returns the number of keys deleted.
Redis Docs
Source§fn exists<'a, K>(&'a mut self, key: K) -> Result<bool, RedisError>
fn exists<'a, K>(&'a mut self, key: K) -> Result<bool, RedisError>
Determine if a key exists.
Redis Docs
Source§fn key_type<'a, K>(&'a mut self, key: K) -> Result<ValueType, RedisError>
fn key_type<'a, K>(&'a mut self, key: K) -> Result<ValueType, RedisError>
Determine the type of key.
Redis Docs
Source§fn expire<'a, K>(&'a mut self, key: K, seconds: i64) -> Result<bool, RedisError>
fn expire<'a, K>(&'a mut self, key: K, seconds: i64) -> Result<bool, RedisError>
Set a key’s time to live in seconds.
Returns whether expiration was set.
Redis Docs
Source§fn expire_at<'a, K>(&'a mut self, key: K, ts: i64) -> Result<bool, RedisError>
fn expire_at<'a, K>(&'a mut self, key: K, ts: i64) -> Result<bool, RedisError>
Set the expiration for a key as a UNIX timestamp.
Returns whether expiration was set.
Redis Docs
Source§fn pexpire<'a, K>(&'a mut self, key: K, ms: i64) -> Result<bool, RedisError>
fn pexpire<'a, K>(&'a mut self, key: K, ms: i64) -> Result<bool, RedisError>
Set a key’s time to live in milliseconds.
Returns whether expiration was set.
Redis Docs
Source§fn pexpire_at<'a, K>(&'a mut self, key: K, ts: i64) -> Result<bool, RedisError>
fn pexpire_at<'a, K>(&'a mut self, key: K, ts: i64) -> Result<bool, RedisError>
Set the expiration for a key as a UNIX timestamp in milliseconds.
Returns whether expiration was set.
Redis Docs
Source§fn expire_time<'a, K>(
&'a mut self,
key: K,
) -> Result<IntegerReplyOrNoOp, RedisError>
fn expire_time<'a, K>( &'a mut self, key: K, ) -> Result<IntegerReplyOrNoOp, RedisError>
Get the absolute Unix expiration timestamp in seconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn pexpire_time<'a, K>(
&'a mut self,
key: K,
) -> Result<IntegerReplyOrNoOp, RedisError>
fn pexpire_time<'a, K>( &'a mut self, key: K, ) -> Result<IntegerReplyOrNoOp, RedisError>
Get the absolute Unix expiration timestamp in milliseconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn persist<'a, K>(&'a mut self, key: K) -> Result<bool, RedisError>
fn persist<'a, K>(&'a mut self, key: K) -> Result<bool, RedisError>
Remove the expiration from a key.
Returns whether a timeout was removed.
Redis Docs
Source§fn ttl<'a, K>(&'a mut self, key: K) -> Result<IntegerReplyOrNoOp, RedisError>
fn ttl<'a, K>(&'a mut self, key: K) -> Result<IntegerReplyOrNoOp, RedisError>
Get the time to live for a key in seconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn pttl<'a, K>(&'a mut self, key: K) -> Result<IntegerReplyOrNoOp, RedisError>
fn pttl<'a, K>(&'a mut self, key: K) -> Result<IntegerReplyOrNoOp, RedisError>
Get the time to live for a key in milliseconds.
Returns
ExistsButNotRelevant
if key exists but has no expiration time.
Redis DocsSource§fn get_ex<'a, K>(
&'a mut self,
key: K,
expire_at: Expiry,
) -> Result<Option<String>, RedisError>
fn get_ex<'a, K>( &'a mut self, key: K, expire_at: Expiry, ) -> Result<Option<String>, RedisError>
Get the value of a key and set expiration
Redis Docs
Source§fn get_del<'a, K>(&'a mut self, key: K) -> Result<Option<String>, RedisError>
fn get_del<'a, K>(&'a mut self, key: K) -> Result<Option<String>, RedisError>
Get the value of a key and delete it
Redis Docs
Source§fn copy<'a, KSrc, KDst, Db>(
&'a mut self,
source: KSrc,
destination: KDst,
options: CopyOptions<Db>,
) -> Result<bool, RedisError>where
KSrc: ToRedisArgs + Send + Sync + 'a,
KDst: ToRedisArgs + Send + Sync + 'a,
Db: ToString + Send + Sync + 'a,
fn copy<'a, KSrc, KDst, Db>(
&'a mut self,
source: KSrc,
destination: KDst,
options: CopyOptions<Db>,
) -> Result<bool, RedisError>where
KSrc: ToRedisArgs + Send + Sync + 'a,
KDst: ToRedisArgs + Send + Sync + 'a,
Db: ToString + Send + Sync + 'a,
Copy the value from one key to another, returning whether the copy was successful.
Redis Docs
Source§fn rename<'a, K, N>(&'a mut self, key: K, new_key: N) -> Result<(), RedisError>
fn rename<'a, K, N>(&'a mut self, key: K, new_key: N) -> Result<(), RedisError>
Rename a key.
Errors if key does not exist.
Redis Docs
Source§fn rename_nx<'a, K, N>(
&'a mut self,
key: K,
new_key: N,
) -> Result<bool, RedisError>
fn rename_nx<'a, K, N>( &'a mut self, key: K, new_key: N, ) -> Result<bool, RedisError>
Rename a key, only if the new key does not exist.
Errors if key does not exist.
Returns whether the key was renamed, or false if the new key already exists.
Redis Docs
Source§fn unlink<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn unlink<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Unlink one or more keys. This is a non-blocking version of
DEL
.
Returns number of keys unlinked.
Redis DocsSource§fn append<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
fn append<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
Append a value to a key.
Returns length of string after operation.
Redis Docs
Source§fn incr<'a, K, V>(&'a mut self, key: K, delta: V) -> Result<isize, RedisError>
fn incr<'a, K, V>(&'a mut self, key: K, delta: V) -> Result<isize, RedisError>
Increment the numeric value of a key by the given amount. This
issues a
INCRBY
or INCRBYFLOAT
depending on the type.
If the key does not exist, it is set to 0 before performing the operation.Source§fn decr<'a, K, V>(&'a mut self, key: K, delta: V) -> Result<isize, RedisError>
fn decr<'a, K, V>(&'a mut self, key: K, delta: V) -> Result<isize, RedisError>
Decrement the numeric value of a key by the given amount.
If the key does not exist, it is set to 0 before performing the operation.
Redis Docs
Source§fn setbit<'a, K>(
&'a mut self,
key: K,
offset: usize,
value: bool,
) -> Result<bool, RedisError>
fn setbit<'a, K>( &'a mut self, key: K, offset: usize, value: bool, ) -> Result<bool, RedisError>
Sets or clears the bit at offset in the string value stored at key.
Returns the original bit value stored at offset.
Redis Docs
Source§fn getbit<'a, K>(
&'a mut self,
key: K,
offset: usize,
) -> Result<bool, RedisError>
fn getbit<'a, K>( &'a mut self, key: K, offset: usize, ) -> Result<bool, RedisError>
Returns the bit value at offset in the string value stored at key.
Redis Docs
Source§fn bitcount<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn bitcount<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Count set bits in a string.
Returns 0 if key does not exist.
Redis Docs
Source§fn bitcount_range<'a, K>(
&'a mut self,
key: K,
start: usize,
end: usize,
) -> Result<usize, RedisError>
fn bitcount_range<'a, K>( &'a mut self, key: K, start: usize, end: usize, ) -> Result<usize, RedisError>
Count set bits in a string in a range.
Returns 0 if key does not exist.
Redis Docs
Source§fn bit_and<'a, D, S>(
&'a mut self,
dstkey: D,
srckeys: S,
) -> Result<usize, RedisError>
fn bit_and<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
Perform a bitwise AND between multiple keys (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“AND)
Source§fn bit_or<'a, D, S>(
&'a mut self,
dstkey: D,
srckeys: S,
) -> Result<usize, RedisError>
fn bit_or<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
Perform a bitwise OR between multiple keys (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“OR)
Source§fn bit_xor<'a, D, S>(
&'a mut self,
dstkey: D,
srckeys: S,
) -> Result<usize, RedisError>
fn bit_xor<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
Perform a bitwise XOR between multiple keys (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“XOR)
Source§fn bit_not<'a, D, S>(
&'a mut self,
dstkey: D,
srckey: S,
) -> Result<usize, RedisError>
fn bit_not<'a, D, S>( &'a mut self, dstkey: D, srckey: S, ) -> Result<usize, RedisError>
Perform a bitwise NOT of the key (containing string values)
and store the result in the destination key.
Returns size of destination string after operation.
Redis Docs.arg(“NOT)
Source§fn strlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn strlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Get the length of the value stored in a key.
0 if key does not exist.
Redis Docs
Source§fn hget<'a, K, F>(
&'a mut self,
key: K,
field: F,
) -> Result<Option<String>, RedisError>
fn hget<'a, K, F>( &'a mut self, key: K, field: F, ) -> Result<Option<String>, RedisError>
Gets a single (or multiple) fields from a hash.
Source§fn hget_ex<'a, K, F>(
&'a mut self,
key: K,
fields: F,
expire_at: Expiry,
) -> Result<Vec<String>, RedisError>
fn hget_ex<'a, K, F>( &'a mut self, key: K, fields: F, expire_at: Expiry, ) -> Result<Vec<String>, RedisError>
Get the value of one or more fields of a given hash key, and optionally set their expiration
Redis Docs.arg(key).arg(expire_at).arg(“FIELDS)
Source§fn hdel<'a, K, F>(&'a mut self, key: K, field: F) -> Result<usize, RedisError>
fn hdel<'a, K, F>(&'a mut self, key: K, field: F) -> Result<usize, RedisError>
Deletes a single (or multiple) fields from a hash.
Returns number of fields deleted.
Redis Docs
Source§fn hget_del<'a, K, F>(
&'a mut self,
key: K,
fields: F,
) -> Result<Vec<Option<String>>, RedisError>
fn hget_del<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<Option<String>>, RedisError>
Get and delete the value of one or more fields of a given hash key
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hset<'a, K, F, V>(
&'a mut self,
key: K,
field: F,
value: V,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn hset<'a, K, F, V>(
&'a mut self,
key: K,
field: F,
value: V,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Sets a single field in a hash.
Returns number of fields added.
Redis Docs
Source§fn hset_ex<'a, K, F, V>(
&'a mut self,
key: K,
hash_field_expiration_options: &'a HashFieldExpirationOptions,
fields_values: &'a [(F, V)],
) -> Result<bool, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn hset_ex<'a, K, F, V>(
&'a mut self,
key: K,
hash_field_expiration_options: &'a HashFieldExpirationOptions,
fields_values: &'a [(F, V)],
) -> Result<bool, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Set the value of one or more fields of a given hash key, and optionally set their expiration
Redis Docs.arg(key).arg(hash_field_expiration_options).arg(“FIELDS)
Source§fn hset_nx<'a, K, F, V>(
&'a mut self,
key: K,
field: F,
value: V,
) -> Result<bool, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn hset_nx<'a, K, F, V>(
&'a mut self,
key: K,
field: F,
value: V,
) -> Result<bool, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Sets a single field in a hash if it does not exist.
Returns whether the field was added.
Redis Docs
Source§fn hset_multiple<'a, K, F, V>(
&'a mut self,
key: K,
items: &'a [(F, V)],
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn hset_multiple<'a, K, F, V>(
&'a mut self,
key: K,
items: &'a [(F, V)],
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Sets multiple fields in a hash.
Redis Docs
Source§fn hincr<'a, K, F, D>(
&'a mut self,
key: K,
field: F,
delta: D,
) -> Result<f64, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
D: ToRedisArgs + Send + Sync + 'a,
fn hincr<'a, K, F, D>(
&'a mut self,
key: K,
field: F,
delta: D,
) -> Result<f64, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
D: ToRedisArgs + Send + Sync + 'a,
Increments a value.
Returns the new value of the field after incrementation.
Source§fn hexists<'a, K, F>(&'a mut self, key: K, field: F) -> Result<bool, RedisError>
fn hexists<'a, K, F>(&'a mut self, key: K, field: F) -> Result<bool, RedisError>
Checks if a field in a hash exists.
Redis Docs
Source§fn httl<'a, K, F>(
&'a mut self,
key: K,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn httl<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Get one or more fields’ TTL in seconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hpttl<'a, K, F>(
&'a mut self,
key: K,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hpttl<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Get one or more fields’ TTL in milliseconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hexpire<'a, K, F>(
&'a mut self,
key: K,
seconds: i64,
opt: ExpireOption,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hexpire<'a, K, F>( &'a mut self, key: K, seconds: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Set one or more fields’ time to live in seconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with 0 seconds.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(seconds).arg(opt).arg(“FIELDS)
Source§fn hexpire_at<'a, K, F>(
&'a mut self,
key: K,
ts: i64,
opt: ExpireOption,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hexpire_at<'a, K, F>( &'a mut self, key: K, ts: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Set the expiration for one or more fields as a UNIX timestamp in milliseconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with a time in the past.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(ts).arg(opt).arg(“FIELDS)
Source§fn hexpire_time<'a, K, F>(
&'a mut self,
key: K,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hexpire_time<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Returns the absolute Unix expiration timestamp in seconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hpersist<'a, K, F>(
&'a mut self,
key: K,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hpersist<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Remove the expiration from a key.
Returns 1 if the expiration was removed.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hpexpire<'a, K, F>(
&'a mut self,
key: K,
milliseconds: i64,
opt: ExpireOption,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hpexpire<'a, K, F>( &'a mut self, key: K, milliseconds: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Set one or more fields’ time to live in milliseconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with 0 seconds.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(milliseconds).arg(opt).arg(“FIELDS)
Source§fn hpexpire_at<'a, K, F>(
&'a mut self,
key: K,
ts: i64,
opt: ExpireOption,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hpexpire_at<'a, K, F>( &'a mut self, key: K, ts: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Set the expiration for one or more fields as a UNIX timestamp in milliseconds.
Returns an array where each element corresponds to the field at the same index in the fields argument.
Each element of the array is either:
0 if the specified condition has not been met.
1 if the expiration time was updated.
2 if called with a time in the past.
Errors if provided key exists but is not a hash.
Redis Docs.arg(key).arg(ts).arg(opt).arg(“FIELDS)
Source§fn hpexpire_time<'a, K, F>(
&'a mut self,
key: K,
fields: F,
) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
fn hpexpire_time<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
Returns the absolute Unix expiration timestamp in seconds.
Redis Docs.arg(key).arg(“FIELDS)
Source§fn hkeys<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
fn hkeys<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
Gets all the keys in a hash.
Redis Docs
Source§fn hvals<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
fn hvals<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
Gets all the values in a hash.
Redis Docs
Source§fn hgetall<'a, K>(
&'a mut self,
key: K,
) -> Result<HashMap<String, String>, RedisError>
fn hgetall<'a, K>( &'a mut self, key: K, ) -> Result<HashMap<String, String>, RedisError>
Gets all the fields and values in a hash.
Redis Docs
Source§fn hlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn hlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Gets the length of a hash.
Returns 0 if key does not exist.
Redis Docs
Source§fn blmove<'a, S, D>(
&'a mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
timeout: f64,
) -> Result<Option<String>, RedisError>
fn blmove<'a, S, D>( &'a mut self, srckey: S, dstkey: D, src_dir: Direction, dst_dir: Direction, timeout: f64, ) -> Result<Option<String>, RedisError>
Pop an element from a list, push it to another list
and return it; or block until one is available
Redis Docs
Source§fn blmpop<'a, K>(
&'a mut self,
timeout: f64,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> Result<Option<[String; 2]>, RedisError>
fn blmpop<'a, K>( &'a mut self, timeout: f64, numkeys: usize, key: K, dir: Direction, count: usize, ) -> Result<Option<[String; 2]>, RedisError>
Pops
count
elements from the first non-empty list key from the list of
provided key names; or blocks until one is available.
Redis Docs.arg(timeout).arg(numkeys).arg(key).arg(dir).arg(“COUNT)Source§fn blpop<'a, K>(
&'a mut self,
key: K,
timeout: f64,
) -> Result<Option<[String; 2]>, RedisError>
fn blpop<'a, K>( &'a mut self, key: K, timeout: f64, ) -> Result<Option<[String; 2]>, RedisError>
Remove and get the first element in a list, or block until one is available.
Redis Docs
Source§fn brpop<'a, K>(
&'a mut self,
key: K,
timeout: f64,
) -> Result<Option<[String; 2]>, RedisError>
fn brpop<'a, K>( &'a mut self, key: K, timeout: f64, ) -> Result<Option<[String; 2]>, RedisError>
Remove and get the last element in a list, or block until one is available.
Redis Docs
Source§fn brpoplpush<'a, S, D>(
&'a mut self,
srckey: S,
dstkey: D,
timeout: f64,
) -> Result<Option<String>, RedisError>
fn brpoplpush<'a, S, D>( &'a mut self, srckey: S, dstkey: D, timeout: f64, ) -> Result<Option<String>, RedisError>
Pop a value from a list, push it to another list and return it;
or block until one is available.
Redis Docs
Source§fn lindex<'a, K>(
&'a mut self,
key: K,
index: isize,
) -> Result<Option<String>, RedisError>
fn lindex<'a, K>( &'a mut self, key: K, index: isize, ) -> Result<Option<String>, RedisError>
Get an element from a list by its index.
Redis Docs
Source§fn linsert_before<'a, K, P, V>(
&'a mut self,
key: K,
pivot: P,
value: V,
) -> Result<isize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
P: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn linsert_before<'a, K, P, V>(
&'a mut self,
key: K,
pivot: P,
value: V,
) -> Result<isize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
P: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Insert an element before another element in a list.
Redis Docs
Source§fn linsert_after<'a, K, P, V>(
&'a mut self,
key: K,
pivot: P,
value: V,
) -> Result<isize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
P: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn linsert_after<'a, K, P, V>(
&'a mut self,
key: K,
pivot: P,
value: V,
) -> Result<isize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
P: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Insert an element after another element in a list.
Redis Docs
Source§fn llen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn llen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Returns the length of the list stored at key.
Redis Docs
Source§fn lmove<'a, S, D>(
&'a mut self,
srckey: S,
dstkey: D,
src_dir: Direction,
dst_dir: Direction,
) -> Result<String, RedisError>
fn lmove<'a, S, D>( &'a mut self, srckey: S, dstkey: D, src_dir: Direction, dst_dir: Direction, ) -> Result<String, RedisError>
Pop an element a list, push it to another list and return it
Redis Docs
Source§fn lmpop<'a, K>(
&'a mut self,
numkeys: usize,
key: K,
dir: Direction,
count: usize,
) -> Result<Option<(String, Vec<String>)>, RedisError>
fn lmpop<'a, K>( &'a mut self, numkeys: usize, key: K, dir: Direction, count: usize, ) -> Result<Option<(String, Vec<String>)>, RedisError>
Pops
count
elements from the first non-empty list key from the list of
provided key names.
Redis Docs.arg(numkeys).arg(key).arg(dir).arg(“COUNT)Source§fn lpop<'a, RV, K>(
&'a mut self,
key: K,
count: Option<NonZero<usize>>,
) -> Result<RV, RedisError>
fn lpop<'a, RV, K>( &'a mut self, key: K, count: Option<NonZero<usize>>, ) -> Result<RV, RedisError>
Removes and returns the up to
count
first elements of the list stored at key. Read moreSource§fn lpos<'a, RV, K, V>(
&'a mut self,
key: K,
value: V,
options: LposOptions,
) -> Result<RV, RedisError>
fn lpos<'a, RV, K, V>( &'a mut self, key: K, value: V, options: LposOptions, ) -> Result<RV, RedisError>
Returns the index of the first matching value of the list stored at key.
Redis Docs
Source§fn lpush<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
fn lpush<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
Insert all the specified values at the head of the list stored at key.
Redis Docs
Source§fn lpush_exists<'a, K, V>(
&'a mut self,
key: K,
value: V,
) -> Result<usize, RedisError>
fn lpush_exists<'a, K, V>( &'a mut self, key: K, value: V, ) -> Result<usize, RedisError>
Inserts a value at the head of the list stored at key, only if key
already exists and holds a list.
Redis Docs
Source§fn lrange<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<Vec<String>, RedisError>
fn lrange<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<Vec<String>, RedisError>
Returns the specified elements of the list stored at key.
Redis Docs
Source§fn lrem<'a, K, V>(
&'a mut self,
key: K,
count: isize,
value: V,
) -> Result<usize, RedisError>
fn lrem<'a, K, V>( &'a mut self, key: K, count: isize, value: V, ) -> Result<usize, RedisError>
Removes the first count occurrences of elements equal to value
from the list stored at key.
Redis Docs
Source§fn ltrim<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<(), RedisError>
fn ltrim<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<(), RedisError>
Trim an existing list so that it will contain only the specified
range of elements specified.
Redis Docs
Source§fn lset<'a, K, V>(
&'a mut self,
key: K,
index: isize,
value: V,
) -> Result<(), RedisError>
fn lset<'a, K, V>( &'a mut self, key: K, index: isize, value: V, ) -> Result<(), RedisError>
Sets the list element at index to value
Redis Docs
Source§fn ping<'a>(&'a mut self) -> Result<String, RedisError>
fn ping<'a>(&'a mut self) -> Result<String, RedisError>
Sends a ping to the server
Redis Docs
Source§fn ping_message<'a, K>(&'a mut self, message: K) -> Result<String, RedisError>
fn ping_message<'a, K>(&'a mut self, message: K) -> Result<String, RedisError>
Sends a ping with a message to the server
Redis Docs
Source§fn rpop<'a, RV, K>(
&'a mut self,
key: K,
count: Option<NonZero<usize>>,
) -> Result<RV, RedisError>
fn rpop<'a, RV, K>( &'a mut self, key: K, count: Option<NonZero<usize>>, ) -> Result<RV, RedisError>
Removes and returns the up to
count
last elements of the list stored at key Read moreSource§fn rpoplpush<'a, K, D>(
&'a mut self,
key: K,
dstkey: D,
) -> Result<Option<String>, RedisError>
fn rpoplpush<'a, K, D>( &'a mut self, key: K, dstkey: D, ) -> Result<Option<String>, RedisError>
Pop a value from a list, push it to another list and return it.
Redis Docs
Source§fn rpush<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
fn rpush<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
Insert all the specified values at the tail of the list stored at key.
Redis Docs
Source§fn rpush_exists<'a, K, V>(
&'a mut self,
key: K,
value: V,
) -> Result<usize, RedisError>
fn rpush_exists<'a, K, V>( &'a mut self, key: K, value: V, ) -> Result<usize, RedisError>
Inserts value at the tail of the list stored at key, only if key
already exists and holds a list.
Redis Docs
Source§fn sadd<'a, K, M>(&'a mut self, key: K, member: M) -> Result<usize, RedisError>
fn sadd<'a, K, M>(&'a mut self, key: K, member: M) -> Result<usize, RedisError>
Add one or more members to a set.
Redis Docs
Source§fn scard<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn scard<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Get the number of members in a set.
Redis Docs
Source§fn sdiff<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
fn sdiff<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
Subtract multiple sets.
Redis Docs
Source§fn sdiffstore<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn sdiffstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Subtract multiple sets and store the resulting set in a key.
Redis Docs
Source§fn sinter<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
fn sinter<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
Intersect multiple sets.
Redis Docs
Source§fn sinterstore<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn sinterstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Intersect multiple sets and store the resulting set in a key.
Redis Docs
Source§fn sismember<'a, K, M>(
&'a mut self,
key: K,
member: M,
) -> Result<bool, RedisError>
fn sismember<'a, K, M>( &'a mut self, key: K, member: M, ) -> Result<bool, RedisError>
Determine if a given value is a member of a set.
Redis Docs
Source§fn smismember<'a, K, M>(
&'a mut self,
key: K,
members: M,
) -> Result<Vec<bool>, RedisError>
fn smismember<'a, K, M>( &'a mut self, key: K, members: M, ) -> Result<Vec<bool>, RedisError>
Determine if given values are members of a set.
Redis Docs
Source§fn smembers<'a, K>(&'a mut self, key: K) -> Result<HashSet<String>, RedisError>
fn smembers<'a, K>(&'a mut self, key: K) -> Result<HashSet<String>, RedisError>
Get all the members in a set.
Redis Docs
Source§fn smove<'a, S, D, M>(
&'a mut self,
srckey: S,
dstkey: D,
member: M,
) -> Result<bool, RedisError>where
S: ToRedisArgs + Send + Sync + 'a,
D: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn smove<'a, S, D, M>(
&'a mut self,
srckey: S,
dstkey: D,
member: M,
) -> Result<bool, RedisError>where
S: ToRedisArgs + Send + Sync + 'a,
D: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Move a member from one set to another.
Redis Docs
Source§fn spop<'a, RV, K>(&'a mut self, key: K) -> Result<RV, RedisError>
fn spop<'a, RV, K>(&'a mut self, key: K) -> Result<RV, RedisError>
Remove and return a random member from a set.
Redis Docs
Source§fn srandmember<'a, K>(
&'a mut self,
key: K,
) -> Result<Option<String>, RedisError>
fn srandmember<'a, K>( &'a mut self, key: K, ) -> Result<Option<String>, RedisError>
Get one random member from a set.
Redis Docs
Source§fn srandmember_multiple<'a, K>(
&'a mut self,
key: K,
count: usize,
) -> Result<Vec<String>, RedisError>
fn srandmember_multiple<'a, K>( &'a mut self, key: K, count: usize, ) -> Result<Vec<String>, RedisError>
Get multiple random members from a set.
Redis Docs
Source§fn srem<'a, K, M>(&'a mut self, key: K, member: M) -> Result<usize, RedisError>
fn srem<'a, K, M>(&'a mut self, key: K, member: M) -> Result<usize, RedisError>
Remove one or more members from a set.
Redis Docs
Source§fn sunion<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
fn sunion<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
Add multiple sets.
Redis Docs
Source§fn sunionstore<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn sunionstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Add multiple sets and store the resulting set in a key.
Redis Docs
Source§fn zadd<'a, K, S, M>(
&'a mut self,
key: K,
member: M,
score: S,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zadd<'a, K, S, M>(
&'a mut self,
key: K,
member: M,
score: S,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Add one member to a sorted set, or update its score if it already exists.
Redis Docs
Source§fn zadd_multiple<'a, K, S, M>(
&'a mut self,
key: K,
items: &'a [(S, M)],
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zadd_multiple<'a, K, S, M>(
&'a mut self,
key: K,
items: &'a [(S, M)],
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Add multiple members to a sorted set, or update its score if it already exists.
Redis Docs
Source§fn zcard<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn zcard<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Get the number of members in a sorted set.
Redis Docs
Source§fn zcount<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zcount<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Count the members in a sorted set with scores within the given values.
Redis Docs
Source§fn zincr<'a, K, M, D>(
&'a mut self,
key: K,
member: M,
delta: D,
) -> Result<f64, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
D: ToRedisArgs + Send + Sync + 'a,
fn zincr<'a, K, M, D>(
&'a mut self,
key: K,
member: M,
delta: D,
) -> Result<f64, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
D: ToRedisArgs + Send + Sync + 'a,
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.
Redis Docs
Source§fn zinterstore<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn zinterstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Intersect multiple sorted sets and store the resulting sorted set in
a new key using SUM as aggregation function.
Redis Docs
Source§fn zinterstore_min<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn zinterstore_min<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Intersect multiple sorted sets and store the resulting sorted set in
a new key using MIN as aggregation function.
Redis Docs
Source§fn zinterstore_max<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn zinterstore_max<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Intersect multiple sorted sets and store the resulting sorted set in
a new key using MAX as aggregation function.
Redis Docs
Source§fn zinterstore_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
fn zinterstore_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
Commands::zinterstore
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Redis DocsSource§fn zinterstore_min_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
fn zinterstore_min_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
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.
Redis DocsSource§fn zinterstore_max_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
fn zinterstore_max_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
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.
Redis DocsSource§fn zlexcount<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zlexcount<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Count the number of members in a sorted set between a given lexicographical range.
Redis Docs
Source§fn bzpopmax<'a, K>(
&'a mut self,
key: K,
timeout: f64,
) -> Result<Option<(String, String, f64)>, RedisError>
fn bzpopmax<'a, K>( &'a mut self, key: K, timeout: f64, ) -> Result<Option<(String, String, f64)>, RedisError>
Removes and returns the member with the highest score in a sorted set.
Blocks until a member is available otherwise.
Redis Docs
Source§fn zpopmax<'a, K>(
&'a mut self,
key: K,
count: isize,
) -> Result<Vec<String>, RedisError>
fn zpopmax<'a, K>( &'a mut self, key: K, count: isize, ) -> Result<Vec<String>, RedisError>
Removes and returns up to count members with the highest scores in a sorted set
Redis Docs
Source§fn bzpopmin<'a, K>(
&'a mut self,
key: K,
timeout: f64,
) -> Result<Option<(String, String, f64)>, RedisError>
fn bzpopmin<'a, K>( &'a mut self, key: K, timeout: f64, ) -> Result<Option<(String, String, f64)>, RedisError>
Removes and returns the member with the lowest score in a sorted set.
Blocks until a member is available otherwise.
Redis Docs
Source§fn zpopmin<'a, K>(
&'a mut self,
key: K,
count: isize,
) -> Result<Vec<String>, RedisError>
fn zpopmin<'a, K>( &'a mut self, key: K, count: isize, ) -> Result<Vec<String>, RedisError>
Removes and returns up to count members with the lowest scores in a sorted set
Redis Docs
Source§fn bzmpop_max<'a, K>(
&'a mut self,
timeout: f64,
keys: K,
count: isize,
) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
fn bzmpop_max<'a, K>( &'a mut self, timeout: f64, keys: K, count: isize, ) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
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.
Redis Docs
Source§fn zmpop_max<'a, K>(
&'a mut self,
keys: K,
count: isize,
) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
fn zmpop_max<'a, K>( &'a mut self, keys: K, count: isize, ) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
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.
Redis Docs
Source§fn bzmpop_min<'a, K>(
&'a mut self,
timeout: f64,
keys: K,
count: isize,
) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
fn bzmpop_min<'a, K>( &'a mut self, timeout: f64, keys: K, count: isize, ) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
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.
Redis Docs
Source§fn zmpop_min<'a, K>(
&'a mut self,
keys: K,
count: isize,
) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
fn zmpop_min<'a, K>( &'a mut self, keys: K, count: isize, ) -> Result<Option<(String, Vec<(String, f64)>)>, RedisError>
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.
Redis Docs
Source§fn zrandmember<'a, RV, K>(
&'a mut self,
key: K,
count: Option<isize>,
) -> Result<RV, RedisError>
fn zrandmember<'a, RV, K>( &'a mut self, key: K, count: Option<isize>, ) -> Result<RV, RedisError>
Return up to count random members in a sorted set (or 1 if
count == None
)
Redis DocsSource§fn zrandmember_withscores<'a, RV, K>(
&'a mut self,
key: K,
count: isize,
) -> Result<RV, RedisError>
fn zrandmember_withscores<'a, RV, K>( &'a mut self, key: K, count: isize, ) -> Result<RV, RedisError>
Return up to count random members in a sorted set with scores
Redis Docs
Source§fn zrange<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<Vec<String>, RedisError>
fn zrange<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<Vec<String>, RedisError>
Return a range of members in a sorted set, by index
Redis Docs
Source§fn zrange_withscores<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<Vec<(String, f64)>, RedisError>
fn zrange_withscores<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<Vec<(String, f64)>, RedisError>
Return a range of members in a sorted set, by index with scores.
Redis Docs
Source§fn zrangebylex<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrangebylex<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by lexicographical range.
Redis Docs
Source§fn zrangebylex_limit<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrangebylex_limit<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by lexicographical
range with offset and limit.
Redis Docs
Source§fn zrevrangebylex<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zrevrangebylex<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by lexicographical range.
Redis Docs
Source§fn zrevrangebylex_limit<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zrevrangebylex_limit<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by lexicographical
range with offset and limit.
Redis Docs
Source§fn zrangebyscore<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrangebyscore<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score.
Redis Docs
Source§fn zrangebyscore_withscores<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<Vec<(String, usize)>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrangebyscore_withscores<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<Vec<(String, usize)>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score with scores.
Redis Docs
Source§fn zrangebyscore_limit<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrangebyscore_limit<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score with limit.
Redis Docs
Source§fn zrangebyscore_limit_withscores<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<Vec<(String, usize)>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrangebyscore_limit_withscores<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
offset: isize,
count: isize,
) -> Result<Vec<(String, usize)>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score with limit with scores.
Redis Docs
Source§fn zrank<'a, K, M>(
&'a mut self,
key: K,
member: M,
) -> Result<Option<usize>, RedisError>
fn zrank<'a, K, M>( &'a mut self, key: K, member: M, ) -> Result<Option<usize>, RedisError>
Determine the index of a member in a sorted set.
Redis Docs
Source§fn zrem<'a, K, M>(&'a mut self, key: K, members: M) -> Result<usize, RedisError>
fn zrem<'a, K, M>(&'a mut self, key: K, members: M) -> Result<usize, RedisError>
Remove one or more members from a sorted set.
Redis Docs
Source§fn zrembylex<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrembylex<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Remove all members in a sorted set between the given lexicographical range.
Redis Docs
Source§fn zremrangebyrank<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<usize, RedisError>
fn zremrangebyrank<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<usize, RedisError>
Remove all members in a sorted set within the given indexes.
Redis Docs
Source§fn zrembyscore<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
fn zrembyscore<'a, K, M, MM>(
&'a mut self,
key: K,
min: M,
max: MM,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
Remove all members in a sorted set within the given scores.
Redis Docs
Source§fn zrevrange<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<Vec<String>, RedisError>
fn zrevrange<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<Vec<String>, RedisError>
Return a range of members in a sorted set, by index,
ordered from high to low.
Redis Docs
Source§fn zrevrange_withscores<'a, K>(
&'a mut self,
key: K,
start: isize,
stop: isize,
) -> Result<Vec<String>, RedisError>
fn zrevrange_withscores<'a, K>( &'a mut self, key: K, start: isize, stop: isize, ) -> Result<Vec<String>, RedisError>
Return a range of members in a sorted set, by index, with scores
ordered from high to low.
Redis Docs
Source§fn zrevrangebyscore<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zrevrangebyscore<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score.
Redis Docs
Source§fn zrevrangebyscore_withscores<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zrevrangebyscore_withscores<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score with scores.
Redis Docs
Source§fn zrevrangebyscore_limit<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zrevrangebyscore_limit<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score with limit.
Redis Docs
Source§fn zrevrangebyscore_limit_withscores<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
fn zrevrangebyscore_limit_withscores<'a, K, MM, M>(
&'a mut self,
key: K,
max: MM,
min: M,
offset: isize,
count: isize,
) -> Result<Vec<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
MM: ToRedisArgs + Send + Sync + 'a,
M: ToRedisArgs + Send + Sync + 'a,
Return a range of members in a sorted set, by score with limit with scores.
Redis Docs
Source§fn zrevrank<'a, K, M>(
&'a mut self,
key: K,
member: M,
) -> Result<Option<usize>, RedisError>
fn zrevrank<'a, K, M>( &'a mut self, key: K, member: M, ) -> Result<Option<usize>, RedisError>
Determine the index of a member in a sorted set, with scores ordered from high to low.
Redis Docs
Source§fn zscore<'a, K, M>(
&'a mut self,
key: K,
member: M,
) -> Result<Option<f64>, RedisError>
fn zscore<'a, K, M>( &'a mut self, key: K, member: M, ) -> Result<Option<f64>, RedisError>
Get the score associated with the given member in a sorted set.
Redis Docs
Source§fn zscore_multiple<'a, K, M>(
&'a mut self,
key: K,
members: &'a [M],
) -> Result<Option<Vec<f64>>, RedisError>
fn zscore_multiple<'a, K, M>( &'a mut self, key: K, members: &'a [M], ) -> Result<Option<Vec<f64>>, RedisError>
Get the scores associated with multiple members in a sorted set.
Redis Docs
Source§fn zunionstore<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn zunionstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Unions multiple sorted sets and store the resulting sorted set in
a new key using SUM as aggregation function.
Redis Docs
Source§fn zunionstore_min<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn zunionstore_min<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Unions multiple sorted sets and store the resulting sorted set in
a new key using MIN as aggregation function.
Redis Docs
Source§fn zunionstore_max<'a, D, K>(
&'a mut self,
dstkey: D,
keys: K,
) -> Result<usize, RedisError>
fn zunionstore_max<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
Unions multiple sorted sets and store the resulting sorted set in
a new key using MAX as aggregation function.
Redis Docs
Source§fn zunionstore_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
fn zunionstore_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
Commands::zunionstore
, but with the ability to specify a
multiplication factor for each sorted set by pairing one with each key
in a tuple.
Redis DocsSource§fn zunionstore_min_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
fn zunionstore_min_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
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.
Redis DocsSource§fn zunionstore_max_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
fn zunionstore_max_weights<'a, D, K, W>(
&'a mut self,
dstkey: D,
keys: &'a [(K, W)],
) -> Result<usize, RedisError>where
D: ToRedisArgs + Send + Sync + 'a,
K: ToRedisArgs + Send + Sync + 'a,
W: ToRedisArgs + Send + Sync + 'a,
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.
Redis DocsSource§fn pfadd<'a, K, E>(&'a mut self, key: K, element: E) -> Result<bool, RedisError>
fn pfadd<'a, K, E>(&'a mut self, key: K, element: E) -> Result<bool, RedisError>
Adds the specified elements to the specified HyperLogLog.
Redis Docs
Source§fn pfcount<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn pfcount<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Return the approximated cardinality of the set(s) observed by the
HyperLogLog at key(s).
Redis Docs
Source§fn pfmerge<'a, D, S>(
&'a mut self,
dstkey: D,
srckeys: S,
) -> Result<(), RedisError>
fn pfmerge<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<(), RedisError>
Merge N different HyperLogLogs into a single one.
Redis Docs
Source§fn publish<'a, K, E>(
&'a mut self,
channel: K,
message: E,
) -> Result<usize, RedisError>
fn publish<'a, K, E>( &'a mut self, channel: K, message: E, ) -> Result<usize, RedisError>
Posts a message to the given channel.
Redis Docs
Source§fn spublish<'a, K, E>(
&'a mut self,
channel: K,
message: E,
) -> Result<usize, RedisError>
fn spublish<'a, K, E>( &'a mut self, channel: K, message: E, ) -> Result<usize, RedisError>
Posts a message to the given sharded channel.
Redis Docs
Source§fn object_encoding<'a, K>(
&'a mut self,
key: K,
) -> Result<Option<String>, RedisError>
fn object_encoding<'a, K>( &'a mut self, key: K, ) -> Result<Option<String>, RedisError>
Returns the encoding of a key.
Redis Docs
Source§fn object_idletime<'a, K>(
&'a mut self,
key: K,
) -> Result<Option<usize>, RedisError>
fn object_idletime<'a, K>( &'a mut self, key: K, ) -> Result<Option<usize>, RedisError>
Returns the time in seconds since the last access of a key.
Redis Docs
Source§fn object_freq<'a, K>(&'a mut self, key: K) -> Result<Option<usize>, RedisError>
fn object_freq<'a, K>(&'a mut self, key: K) -> Result<Option<usize>, RedisError>
Returns the logarithmic access frequency counter of a key.
Redis Docs
Source§fn object_refcount<'a, K>(
&'a mut self,
key: K,
) -> Result<Option<usize>, RedisError>
fn object_refcount<'a, K>( &'a mut self, key: K, ) -> Result<Option<usize>, RedisError>
Returns the reference count of a key.
Redis Docs
Source§fn client_getname<'a>(&'a mut self) -> Result<Option<String>, RedisError>
fn client_getname<'a>(&'a mut self) -> Result<Option<String>, RedisError>
Returns the name of the current connection as set by CLIENT SETNAME.
Redis Docs
Source§fn client_id<'a>(&'a mut self) -> Result<isize, RedisError>
fn client_id<'a>(&'a mut self) -> Result<isize, RedisError>
Returns the ID of the current connection.
Redis Docs
Source§fn client_setname<'a, K>(
&'a mut self,
connection_name: K,
) -> Result<(), RedisError>
fn client_setname<'a, K>( &'a mut self, connection_name: K, ) -> Result<(), RedisError>
Command assigns a name to the current connection.
Redis Docs
Source§fn acl_load<'a>(&'a mut self) -> Result<(), RedisError>
fn acl_load<'a>(&'a mut self) -> Result<(), RedisError>
When Redis is configured to use an ACL file (with the aclfile
configuration option), this command will reload the ACLs from the file,
replacing all the current ACL rules with the ones defined in the file.
Redis Docs
Source§fn acl_save<'a>(&'a mut self) -> Result<(), RedisError>
fn acl_save<'a>(&'a mut self) -> Result<(), RedisError>
When Redis is configured to use an ACL file (with the aclfile
configuration option), this command will save the currently defined
ACLs from the server memory to the ACL file.
Redis Docs
Source§fn acl_list<'a>(&'a mut self) -> Result<Vec<String>, RedisError>
fn acl_list<'a>(&'a mut self) -> Result<Vec<String>, RedisError>
Shows the currently active ACL rules in the Redis server.
Redis Docs
Source§fn acl_users<'a>(&'a mut self) -> Result<Vec<String>, RedisError>
fn acl_users<'a>(&'a mut self) -> Result<Vec<String>, RedisError>
Shows a list of all the usernames of the currently configured users in
the Redis ACL system.
Redis Docs
Source§fn acl_getuser<'a, K>(
&'a mut self,
username: K,
) -> Result<Option<HashMap<String, Value>>, RedisError>
fn acl_getuser<'a, K>( &'a mut self, username: K, ) -> Result<Option<HashMap<String, Value>>, RedisError>
Returns all the rules defined for an existing ACL user.
Redis Docs
Source§fn acl_setuser<'a, K>(&'a mut self, username: K) -> Result<(), RedisError>
fn acl_setuser<'a, K>(&'a mut self, username: K) -> Result<(), RedisError>
Creates an ACL user without any privilege.
Redis Docs
Source§fn acl_setuser_rules<'a, K>(
&'a mut self,
username: K,
rules: &'a [Rule],
) -> Result<(), RedisError>
fn acl_setuser_rules<'a, K>( &'a mut self, username: K, rules: &'a [Rule], ) -> Result<(), RedisError>
Creates an ACL user with the specified rules or modify the rules of
an existing user.
Redis Docs
Source§fn acl_deluser<'a, K>(
&'a mut self,
usernames: &'a [K],
) -> Result<usize, RedisError>
fn acl_deluser<'a, K>( &'a mut self, usernames: &'a [K], ) -> Result<usize, RedisError>
Delete all the specified ACL users and terminate all the connections
that are authenticated with such users.
Redis Docs
Source§fn acl_dryrun<'a, K, C, A>(
&'a mut self,
username: K,
command: C,
args: A,
) -> Result<String, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
A: ToRedisArgs + Send + Sync + 'a,
fn acl_dryrun<'a, K, C, A>(
&'a mut self,
username: K,
command: C,
args: A,
) -> Result<String, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
A: ToRedisArgs + Send + Sync + 'a,
Simulate the execution of a given command by a given user.
Redis Docs
Source§fn acl_cat<'a>(&'a mut self) -> Result<Vec<String>, RedisError>
fn acl_cat<'a>(&'a mut self) -> Result<Vec<String>, RedisError>
Shows the available ACL categories.
Redis Docs
Source§fn acl_cat_categoryname<'a, K>(
&'a mut self,
categoryname: K,
) -> Result<Vec<String>, RedisError>
fn acl_cat_categoryname<'a, K>( &'a mut self, categoryname: K, ) -> Result<Vec<String>, RedisError>
Shows all the Redis commands in the specified category.
Redis Docs
Source§fn acl_genpass<'a>(&'a mut self) -> Result<String, RedisError>
fn acl_genpass<'a>(&'a mut self) -> Result<String, RedisError>
Generates a 256-bits password starting from /dev/urandom if available.
Redis Docs
Source§fn acl_genpass_bits<'a>(&'a mut self, bits: isize) -> Result<String, RedisError>
fn acl_genpass_bits<'a>(&'a mut self, bits: isize) -> Result<String, RedisError>
Generates a 1-to-1024-bits password starting from /dev/urandom if available.
Redis Docs
Source§fn acl_whoami<'a>(&'a mut self) -> Result<String, RedisError>
fn acl_whoami<'a>(&'a mut self) -> Result<String, RedisError>
Returns the username the current connection is authenticated with.
Redis Docs
Source§fn acl_log<'a>(&'a mut self, count: isize) -> Result<Vec<String>, RedisError>
fn acl_log<'a>(&'a mut self, count: isize) -> Result<Vec<String>, RedisError>
Shows a list of recent ACL security events
Redis Docs
Source§fn acl_log_reset<'a>(&'a mut self) -> Result<(), RedisError>
fn acl_log_reset<'a>(&'a mut self) -> Result<(), RedisError>
Clears the ACL log.
Redis Docs
Source§fn acl_help<'a>(&'a mut self) -> Result<String, RedisError>
fn acl_help<'a>(&'a mut self) -> Result<String, RedisError>
Returns a helpful text describing the different subcommands.
Redis Docs
Source§fn geo_add<'a, K, M>(
&'a mut self,
key: K,
members: M,
) -> Result<usize, RedisError>
fn geo_add<'a, K, M>( &'a mut self, key: K, members: M, ) -> Result<usize, RedisError>
Adds the specified geospatial items to the specified key. Read more
Source§fn geo_dist<'a, K, M1, M2>(
&'a mut self,
key: K,
member1: M1,
member2: M2,
unit: Unit,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M1: ToRedisArgs + Send + Sync + 'a,
M2: ToRedisArgs + Send + Sync + 'a,
fn geo_dist<'a, K, M1, M2>(
&'a mut self,
key: K,
member1: M1,
member2: M2,
unit: Unit,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
M1: ToRedisArgs + Send + Sync + 'a,
M2: ToRedisArgs + Send + Sync + 'a,
Return the distance between two members in the geospatial index
represented by the sorted set. Read more
Source§fn geo_hash<'a, K, M>(
&'a mut self,
key: K,
members: M,
) -> Result<Vec<String>, RedisError>
fn geo_hash<'a, K, M>( &'a mut self, key: K, members: M, ) -> Result<Vec<String>, RedisError>
Source§fn geo_pos<'a, K, M>(
&'a mut self,
key: K,
members: M,
) -> Result<Vec<Option<(f64, f64)>>, RedisError>
fn geo_pos<'a, K, M>( &'a mut self, key: K, members: M, ) -> Result<Vec<Option<(f64, f64)>>, RedisError>
Return the positions of all the specified members of the geospatial
index represented by the sorted set at key. Read more
Source§fn geo_radius<'a, RV, K>(
&'a mut self,
key: K,
longitude: f64,
latitude: f64,
radius: f64,
unit: Unit,
options: RadiusOptions,
) -> Result<RV, RedisError>
fn geo_radius<'a, RV, K>( &'a mut self, key: K, longitude: f64, latitude: f64, radius: f64, unit: Unit, options: RadiusOptions, ) -> Result<RV, RedisError>
Source§fn geo_radius_by_member<'a, RV, K, M>(
&'a mut self,
key: K,
member: M,
radius: f64,
unit: Unit,
options: RadiusOptions,
) -> Result<RV, RedisError>
fn geo_radius_by_member<'a, RV, K, M>( &'a mut self, key: K, member: M, radius: f64, unit: Unit, options: RadiusOptions, ) -> Result<RV, RedisError>
Retrieve members selected by distance with the center of
member
. The
member itself is always contained in the results.
Redis DocsSource§fn xack<'a, K, G, I>(
&'a mut self,
key: K,
group: G,
ids: &'a [I],
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
I: ToRedisArgs + Send + Sync + 'a,
fn xack<'a, K, G, I>(
&'a mut self,
key: K,
group: G,
ids: &'a [I],
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
I: ToRedisArgs + Send + Sync + 'a,
Ack pending stream messages checked out by a consumer. Read more
Source§fn xadd<'a, K, ID, F, V>(
&'a mut self,
key: K,
id: ID,
items: &'a [(F, V)],
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn xadd<'a, K, ID, F, V>(
&'a mut self,
key: K,
id: ID,
items: &'a [(F, V)],
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Source§fn xadd_map<'a, K, ID, BTM>(
&'a mut self,
key: K,
id: ID,
map: BTM,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
BTM: ToRedisArgs + Send + Sync + 'a,
fn xadd_map<'a, K, ID, BTM>(
&'a mut self,
key: K,
id: ID,
map: BTM,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
BTM: ToRedisArgs + Send + Sync + 'a,
BTreeMap variant for adding a stream message by
key
.
Use *
as the id
for the current timestamp. Read moreSource§fn xadd_options<'a, K, ID, I>(
&'a mut self,
key: K,
id: ID,
items: I,
options: &'a StreamAddOptions,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
I: ToRedisArgs + Send + Sync + 'a,
fn xadd_options<'a, K, ID, I>(
&'a mut self,
key: K,
id: ID,
items: I,
options: &'a StreamAddOptions,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
I: ToRedisArgs + Send + Sync + 'a,
Add a stream message with options. Read more
Source§fn xadd_maxlen<'a, K, ID, F, V>(
&'a mut self,
key: K,
maxlen: StreamMaxlen,
id: ID,
items: &'a [(F, V)],
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
fn xadd_maxlen<'a, K, ID, F, V>(
&'a mut self,
key: K,
maxlen: StreamMaxlen,
id: ID,
items: &'a [(F, V)],
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
F: ToRedisArgs + Send + Sync + 'a,
V: ToRedisArgs + Send + Sync + 'a,
Add a stream message while capping the stream at a maxlength. Read more
Source§fn xadd_maxlen_map<'a, K, ID, BTM>(
&'a mut self,
key: K,
maxlen: StreamMaxlen,
id: ID,
map: BTM,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
BTM: ToRedisArgs + Send + Sync + 'a,
fn xadd_maxlen_map<'a, K, ID, BTM>(
&'a mut self,
key: K,
maxlen: StreamMaxlen,
id: ID,
map: BTM,
) -> Result<Option<String>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
BTM: ToRedisArgs + Send + Sync + 'a,
BTreeMap variant for adding a stream message while capping the stream at a maxlength. Read more
Source§fn xautoclaim_options<'a, K, G, C, MIT, S>(
&'a mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
start: S,
options: StreamAutoClaimOptions,
) -> Result<(String, Vec<String>, Vec<String>), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
MIT: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
fn xautoclaim_options<'a, K, G, C, MIT, S>(
&'a mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
start: S,
options: StreamAutoClaimOptions,
) -> Result<(String, Vec<String>, Vec<String>), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
MIT: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
Perform a combined xpending and xclaim flow. Read more
Source§fn xclaim<'a, K, G, C, MIT, ID>(
&'a mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
) -> Result<Vec<(String, Value)>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
MIT: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
fn xclaim<'a, K, G, C, MIT, ID>(
&'a mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
) -> Result<Vec<(String, Value)>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
MIT: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
Claim pending, unacked messages, after some period of time,
currently checked out by another consumer. Read more
Source§fn xclaim_options<'a, RV, K, G, C, MIT, ID>(
&'a mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
options: StreamClaimOptions,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
MIT: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
fn xclaim_options<'a, RV, K, G, C, MIT, ID>(
&'a mut self,
key: K,
group: G,
consumer: C,
min_idle_time: MIT,
ids: &'a [ID],
options: StreamClaimOptions,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
MIT: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
This is the optional arguments version for claiming unacked, pending messages
currently checked out by another consumer. Read more
Source§fn xgroup_create<'a, K, G, ID>(
&'a mut self,
key: K,
group: G,
id: ID,
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
fn xgroup_create<'a, K, G, ID>(
&'a mut self,
key: K,
group: G,
id: ID,
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
This command is used for creating a consumer
group
. It expects the stream key
to already exist. Otherwise, use xgroup_create_mkstream
if it doesn’t.
The id
is the starting message id all consumers should read from. Use $
If you want
all consumers to read from the last message added to stream. Read moreSource§fn xgroup_createconsumer<'a, K, G, C>(
&'a mut self,
key: K,
group: G,
consumer: C,
) -> Result<bool, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
fn xgroup_createconsumer<'a, K, G, C>(
&'a mut self,
key: K,
group: G,
consumer: C,
) -> Result<bool, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
This creates a
consumer
explicitly (vs implicit via XREADGROUP)
for given stream `key. Read moreSource§fn xgroup_create_mkstream<'a, K, G, ID>(
&'a mut self,
key: K,
group: G,
id: ID,
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
fn xgroup_create_mkstream<'a, K, G, ID>(
&'a mut self,
key: K,
group: G,
id: ID,
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
This is the alternate version for creating a consumer
group
which makes the stream if it doesn’t exist. Read moreSource§fn xgroup_setid<'a, K, G, ID>(
&'a mut self,
key: K,
group: G,
id: ID,
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
fn xgroup_setid<'a, K, G, ID>(
&'a mut self,
key: K,
group: G,
id: ID,
) -> Result<(), RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
ID: ToRedisArgs + Send + Sync + 'a,
Source§fn xgroup_destroy<'a, K, G>(
&'a mut self,
key: K,
group: G,
) -> Result<bool, RedisError>
fn xgroup_destroy<'a, K, G>( &'a mut self, key: K, group: G, ) -> Result<bool, RedisError>
Source§fn xgroup_delconsumer<'a, K, G, C>(
&'a mut self,
key: K,
group: G,
consumer: C,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
fn xgroup_delconsumer<'a, K, G, C>(
&'a mut self,
key: K,
group: G,
consumer: C,
) -> Result<usize, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
Source§fn xinfo_consumers<'a, K, G>(
&'a mut self,
key: K,
group: G,
) -> Result<Vec<HashMap<String, Value>>, RedisError>
fn xinfo_consumers<'a, K, G>( &'a mut self, key: K, group: G, ) -> Result<Vec<HashMap<String, Value>>, RedisError>
This returns all info details about
which consumers have read messages for given consumer
group
.
Take note of the StreamInfoConsumersReply return type. Read moreSource§fn xinfo_groups<'a, K>(
&'a mut self,
key: K,
) -> Result<Vec<HashMap<String, Value>>, RedisError>
fn xinfo_groups<'a, K>( &'a mut self, key: K, ) -> Result<Vec<HashMap<String, Value>>, RedisError>
Returns all consumer
group
s created for a given stream key
.
Take note of the StreamInfoGroupsReply return type. Read moreSource§fn xinfo_stream<'a, RV, K>(&'a mut self, key: K) -> Result<RV, RedisError>
fn xinfo_stream<'a, RV, K>(&'a mut self, key: K) -> Result<RV, RedisError>
Returns info about high-level stream details
(first & last message
id
, length, number of groups, etc.)
Take note of the StreamInfoStreamReply return type. Read moreSource§fn xlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
fn xlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
Returns the number of messages for a given stream
key
. Read moreSource§fn xpending<'a, RV, K, G>(
&'a mut self,
key: K,
group: G,
) -> Result<RV, RedisError>
fn xpending<'a, RV, K, G>( &'a mut self, key: K, group: G, ) -> Result<RV, RedisError>
This is a basic version of making XPENDING command calls which only
passes a stream
key
and consumer group
and it
returns details about which consumers have pending messages
that haven’t been acked. Read moreSource§fn xpending_count<'a, RV, K, G, S, E, C>(
&'a mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
fn xpending_count<'a, RV, K, G, S, E, C>(
&'a mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
This XPENDING version returns a list of all messages over the range.
You can use this for paginating pending messages (but without the message HashMap). Read more
Source§fn xpending_consumer_count<'a, RV, K, G, S, E, C, CN>(
&'a mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
consumer: CN,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
CN: ToRedisArgs + Send + Sync + 'a,
fn xpending_consumer_count<'a, RV, K, G, S, E, C, CN>(
&'a mut self,
key: K,
group: G,
start: S,
end: E,
count: C,
consumer: CN,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
G: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
CN: ToRedisArgs + Send + Sync + 'a,
Source§fn xrange<'a, RV, K, S, E>(
&'a mut self,
key: K,
start: S,
end: E,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
fn xrange<'a, RV, K, S, E>(
&'a mut self,
key: K,
start: S,
end: E,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
Returns a range of messages in a given stream
key
. Read moreSource§fn xrange_all<'a, RV, K>(&'a mut self, key: K) -> Result<RV, RedisError>
fn xrange_all<'a, RV, K>(&'a mut self, key: K) -> Result<RV, RedisError>
A helper method for automatically returning all messages in a stream by
key
.
Use with caution! Read moreSource§fn xrange_count<'a, RV, K, S, E, C>(
&'a mut self,
key: K,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
fn xrange_count<'a, RV, K, S, E, C>(
&'a mut self,
key: K,
start: S,
end: E,
count: C,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
K: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
A method for paginating a stream by
key
. Read moreSource§fn xread<'a, K, ID>(
&'a mut self,
keys: &'a [K],
ids: &'a [ID],
) -> Result<Option<HashMap<String, Value>>, RedisError>
fn xread<'a, K, ID>( &'a mut self, keys: &'a [K], ids: &'a [ID], ) -> Result<Option<HashMap<String, Value>>, RedisError>
Read a list of
id
s for each stream key
.
This is the basic form of reading streams.
For more advanced control, like blocking, limiting, or reading by consumer group
,
see xread_options
. Read moreSource§fn xread_options<'a, K, ID>(
&'a mut self,
keys: &'a [K],
ids: &'a [ID],
options: &'a StreamReadOptions,
) -> Result<Option<HashMap<String, Value>>, RedisError>
fn xread_options<'a, K, ID>( &'a mut self, keys: &'a [K], ids: &'a [ID], options: &'a StreamReadOptions, ) -> Result<Option<HashMap<String, Value>>, RedisError>
Source§fn xrevrange<'a, K, E, S>(
&'a mut self,
key: K,
end: E,
start: S,
) -> Result<Vec<Value>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
fn xrevrange<'a, K, E, S>(
&'a mut self,
key: K,
end: E,
start: S,
) -> Result<Vec<Value>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
Source§fn xrevrange_all<'a, K>(&'a mut self, key: K) -> Result<Vec<Value>, RedisError>
fn xrevrange_all<'a, K>(&'a mut self, key: K) -> Result<Vec<Value>, RedisError>
Source§fn xrevrange_count<'a, K, E, S, C>(
&'a mut self,
key: K,
end: E,
start: S,
count: C,
) -> Result<Vec<Value>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
fn xrevrange_count<'a, K, E, S, C>(
&'a mut self,
key: K,
end: E,
start: S,
count: C,
) -> Result<Vec<Value>, RedisError>where
K: ToRedisArgs + Send + Sync + 'a,
E: ToRedisArgs + Send + Sync + 'a,
S: ToRedisArgs + Send + Sync + 'a,
C: ToRedisArgs + Send + Sync + 'a,
Source§fn xtrim<'a, K>(
&'a mut self,
key: K,
maxlen: StreamMaxlen,
) -> Result<usize, RedisError>
fn xtrim<'a, K>( &'a mut self, key: K, maxlen: StreamMaxlen, ) -> Result<usize, RedisError>
Trim a stream
key
to a MAXLEN count. Read moreSource§fn xtrim_options<'a, K>(
&'a mut self,
key: K,
options: &'a StreamTrimOptions,
) -> Result<usize, RedisError>
fn xtrim_options<'a, K>( &'a mut self, key: K, options: &'a StreamTrimOptions, ) -> Result<usize, RedisError>
Trim a stream
key
with full options Read moreSource§fn invoke_script<'a, RV>(
&'a mut self,
invocation: &'a ScriptInvocation<'a>,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
fn invoke_script<'a, RV>(
&'a mut self,
invocation: &'a ScriptInvocation<'a>,
) -> Result<RV, RedisError>where
RV: FromRedisValue,
Adds a prepared script command to the pipeline. Read more
Source§fn flushall<'a>(&'a mut self) -> Result<(), RedisError>
fn flushall<'a>(&'a mut self) -> Result<(), RedisError>
Deletes all the keys of all databases Read more
Source§fn flushall_options<'a>(
&'a mut self,
options: &'a FlushAllOptions,
) -> Result<(), RedisError>
fn flushall_options<'a>( &'a mut self, options: &'a FlushAllOptions, ) -> Result<(), RedisError>
Deletes all the keys of all databases with options Read more
Source§fn flushdb<'a>(&'a mut self) -> Result<(), RedisError>
fn flushdb<'a>(&'a mut self) -> Result<(), RedisError>
Deletes all the keys of the current database Read more
Source§fn flushdb_options<'a>(
&'a mut self,
options: &'a FlushAllOptions,
) -> Result<(), RedisError>
fn flushdb_options<'a>( &'a mut self, options: &'a FlushAllOptions, ) -> Result<(), RedisError>
Deletes all the keys of the current database with options Read more
Source§fn scan<RV>(&mut self) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
fn scan<RV>(&mut self) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
Incrementally iterate the keys space.
Source§fn scan_options<RV>(
&mut self,
opts: ScanOptions,
) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
fn scan_options<RV>(
&mut self,
opts: ScanOptions,
) -> Result<Iter<'_, RV>, RedisError>where
RV: FromRedisValue,
Incrementally iterate the keys space with options.
Source§fn scan_match<P, RV>(&mut self, pattern: P) -> Result<Iter<'_, RV>, RedisError>where
P: ToRedisArgs,
RV: FromRedisValue,
fn scan_match<P, RV>(&mut self, pattern: P) -> Result<Iter<'_, RV>, RedisError>where
P: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate the keys space for keys matching a pattern.
Source§fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate hash fields and associated values.
Source§fn hscan_match<K, P, RV>(
&mut self,
key: K,
pattern: P,
) -> Result<Iter<'_, RV>, RedisError>
fn hscan_match<K, P, RV>( &mut self, key: K, pattern: P, ) -> Result<Iter<'_, RV>, RedisError>
Incrementally iterate hash fields and associated values for
field names matching a pattern.
Source§fn sscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn sscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate set elements.
Source§fn sscan_match<K, P, RV>(
&mut self,
key: K,
pattern: P,
) -> Result<Iter<'_, RV>, RedisError>
fn sscan_match<K, P, RV>( &mut self, key: K, pattern: P, ) -> Result<Iter<'_, RV>, RedisError>
Incrementally iterate set elements for elements matching a pattern.
Source§fn zscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
fn zscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>where
K: ToRedisArgs,
RV: FromRedisValue,
Incrementally iterate sorted set elements.
Source§fn zscan_match<K, P, RV>(
&mut self,
key: K,
pattern: P,
) -> Result<Iter<'_, RV>, RedisError>
fn zscan_match<K, P, RV>( &mut self, key: K, pattern: P, ) -> Result<Iter<'_, RV>, RedisError>
Incrementally iterate sorted set elements for elements matching a pattern.
Source§fn get_int<K>(&mut self, key: K) -> Result<Option<isize>, RedisError>where
K: ToRedisArgs,
fn get_int<K>(&mut self, key: K) -> Result<Option<isize>, RedisError>where
K: ToRedisArgs,
Get a value from Redis and convert it to an
Option<isize>
.Source§fn mget_ints<K>(&mut self, key: K) -> Result<Vec<Option<isize>>, RedisError>where
K: ToRedisArgs,
fn mget_ints<K>(&mut self, key: K) -> Result<Vec<Option<isize>>, RedisError>where
K: ToRedisArgs,
Get values from Redis and convert them to
Option<isize>
s.