Skip to main content

Json

Struct Json 

Source
pub struct Json<T>(pub T);
Available on crate feature http-server only.
Expand description

JSON Extractor / Response.

When used as an extractor, it can deserialize request bodies into some type that implements [serde::de::DeserializeOwned]. The request will be rejected (and a JsonRejection will be returned) if:

  • The request doesn’t have a Content-Type: application/json (or similar) header.
  • The body doesn’t contain syntactically valid JSON.
  • The body contains syntactically valid JSON, but it couldn’t be deserialized into the target type.
  • Buffering the request body fails.

⚠️ Since parsing JSON requires consuming the request body, the Json extractor must be last if there are multiple extractors in a handler. See “the order of extractors”

See JsonRejection for more details.

§Extractor example

use axum::{
    extract,
    routing::post,
    Router,
};
use serde::Deserialize;

#[derive(Deserialize)]
struct CreateUser {
    email: String,
    password: String,
}

async fn create_user(extract::Json(payload): extract::Json<CreateUser>) {
    // payload is a `CreateUser`
}

let app = Router::new().route("/users", post(create_user));

When used as a response, it can serialize any type that implements [serde::Serialize] to JSON, and will automatically set Content-Type: application/json header.

If the Serialize implementation decides to fail or if a map with non-string keys is used, a 500 response will be issued whose body is the error message in UTF-8.

§Response example

use axum::{
    extract::Path,
    routing::get,
    Router,
    Json,
};
use serde::Serialize;
use uuid::Uuid;

#[derive(Serialize)]
struct User {
    id: Uuid,
    username: String,
}

async fn get_user(Path(user_id) : Path<Uuid>) -> Json<User> {
    let user = find_user(user_id).await;
    Json(user)
}

async fn find_user(user_id: Uuid) -> User {
    // ...
}

let app = Router::new().route("/users/{id}", get(get_user));

Tuple Fields§

§0: T

Implementations§

Source§

impl<T> Json<T>

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Json<T>, JsonRejection>

Construct a Json<T> from a byte slice. Most users should prefer to use the FromRequest impl but special cases may require first extracting a Request into Bytes then optionally constructing a Json<T>.

Trait Implementations§

Source§

impl<T> Clone for Json<T>
where T: Clone,

Source§

fn clone(&self) -> Json<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for Json<T>
where T: Copy,

Source§

impl<T> Debug for Json<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for Json<T>
where T: Default,

Source§

fn default() -> Json<T>

Returns the “default value” for a type. Read more
Source§

impl<T> Deref for Json<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Json<T> as Deref>::Target

Dereferences the value.
Source§

impl<T> DerefMut for Json<T>

Source§

fn deref_mut(&mut self) -> &mut <Json<T> as Deref>::Target

Mutably dereferences the value.
Source§

impl<T> From<T> for Json<T>

Source§

fn from(inner: T) -> Json<T>

Converts to this type from the input type.
Source§

impl<T, S> FromRequest<S> for Json<T>
where T: DeserializeOwned, S: Send + Sync,

Source§

type Rejection = JsonRejection

If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response.
Source§

async fn from_request( req: Request<Body>, state: &S, ) -> Result<Json<T>, <Json<T> as FromRequest<S>>::Rejection>

Perform the extraction.
Source§

impl<T> IntoResponse for Json<T>
where T: Serialize,

Source§

fn into_response(self) -> Response<Body>

Create a response.
Source§

impl<T, S> OptionalFromRequest<S> for Json<T>
where T: DeserializeOwned, S: Send + Sync,

Source§

type Rejection = JsonRejection

If the extractor fails, it will use this “rejection” type. Read more
Source§

async fn from_request( req: Request<Body>, state: &S, ) -> Result<Option<Json<T>>, <Json<T> as OptionalFromRequest<S>>::Rejection>

Perform the extraction.

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> UnsafeUnpin for Json<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Json<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyExt for T
where T: Any + ?Sized,

Source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
Source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
Source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
Source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
Source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
Source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T> AsDebug for T
where T: Debug,

Source§

fn as_debug(&self) -> &dyn Debug

Returns self as a &dyn Debug trait object.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

Source§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

Source§

fn coerce_box_to(self: Box<X>) -> Box<T>

Source§

fn coerce_ref_to(&self) -> &T

Source§

fn coerce_mut_to(&mut self) -> &mut T

Source§

impl<T> Commands for T
where T: ConnectionLike,

Source§

fn get<'a, K, RV>(&mut self, key: K) -> Result<RV, 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 Docs
Source§

fn mget<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Get values of keys Redis Docs
Source§

fn keys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Gets all keys matching pattern Redis Docs
Source§

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>

Set the string value of a key with options. Redis Docs
Source§

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>

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>

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>

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>

Sets multiple keys to their values failing if at least one already exists. Redis Docs
Source§

fn mset_ex<'a, K, V, RV>( &mut self, items: &'a [(K, V)], options: MSetOptions, ) -> Result<RV, RedisError>

Sets the given keys to their respective values. This command is an extension of the MSETNX that adds expiration and XX options. Redis Docs
Source§

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>

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>

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>

Delete one or more keys. Returns the number of keys deleted. Redis Docs
Source§

fn del_ex<'a, K, RV>( &mut self, key: K, value_comparison: ValueComparison, ) -> Result<RV, RedisError>

Conditionally removes the specified key. A key is ignored if it does not exist. IFEQ match-value - Delete the key only if its value is equal to match-value IFNE match-value - Delete the key only if its value is not equal to match-value IFDEQ match-digest - Delete the key only if the digest of its value is equal to match-digest IFDNE match-digest - Delete the key only if the digest of its value is not equal to match-digest Redis Docs
Source§

fn digest<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Get the hex signature of the value stored in the specified key. For the digest, Redis will use XXH3 Redis Docs
Source§

fn exists<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Determine if a key exists. Redis Docs
Source§

fn key_type<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Determine the type of key. Redis Docs
Source§

fn expire<'a, K, RV>(&mut self, key: K, seconds: i64) -> Result<RV, RedisError>

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>

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>

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>

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>

Get the absolute Unix expiration timestamp in seconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn pexpire_time<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Get the absolute Unix expiration timestamp in milliseconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn persist<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

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>

Get the time to live for a key in seconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn pttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Get the time to live for a key in milliseconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn get_ex<'a, K, RV>( &mut self, key: K, expire_at: Expiry, ) -> Result<RV, RedisError>

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>

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>

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>

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>

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
Unlink one or more keys. This is a non-blocking version of DEL. Returns number of keys unlinked. Redis Docs
Source§

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>

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>

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>

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>

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>

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>

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>

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
Source§

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
Source§

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
Source§

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
Source§

fn bit_diff<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>

DIFF(X, Y1, Y2, …)
Perform a set difference to extract the members of X that are not members of any of Y1, Y2,….
Logical representation: X ∧ ¬(Y1 ∨ Y2 ∨ …)
Redis Docs
Source§

fn bit_diff1<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>

DIFF1(X, Y1, Y2, …) (Relative complement difference)
Perform a relative complement set difference to extract the members of one or more of Y1, Y2,… that are not members of X.
Logical representation: ¬X ∧ (Y1 ∨ Y2 ∨ …)
Redis Docs
Source§

fn bit_and_or<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>

ANDOR(X, Y1, Y2, …)
Perform an “intersection of union(s)” operation to extract the members of X that are also members of one or more of Y1, Y2,….
Logical representation: X ∧ (Y1 ∨ Y2 ∨ …)
Redis Docs
Source§

fn bit_one<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S, ) -> Result<RV, RedisError>

ONE(X, Y1, Y2, …)
Perform an “exclusive membership” operation to extract the members of exactly one of X, Y1, Y2, ….
Logical representation: (X ∨ Y1 ∨ Y2 ∨ …) ∧ ¬((X ∧ Y1) ∨ (X ∧ Y2) ∨ (Y1 ∧ Y2) ∨ (Y1 ∧ Y3) ∨ …)
Redis Docs
Source§

fn strlen<'a, K, RV>(&mut self, key: K) -> Result<RV, 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, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>

Gets a single (or multiple) fields from a hash.
Source§

fn hmget<'a, K, F, RV>(&mut self, key: K, fields: F) -> Result<RV, RedisError>

Gets multiple fields from a hash. Redis Docs
Source§

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
Source§

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>

Get and delete the value of one or more fields of a given hash key Redis Docs
Source§

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>

Set the value of one or more fields of a given hash key, and optionally set their expiration Redis Docs
Source§

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>

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>

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>

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>

Get one or more fields’ TTL in seconds. Redis Docs
Source§

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
Source§

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
Source§

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 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 a time in the past. Errors if provided key exists but is not a hash. Redis Docs
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

fn hkeys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Gets all the keys in a hash. Redis Docs
Source§

fn hvals<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Gets all the values in a hash. Redis Docs
Source§

fn hgetall<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Gets all the fields and values in a hash. Redis Docs
Source§

fn hlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

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>

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>

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
Source§

fn blpop<'a, K, RV>(&mut self, key: K, timeout: f64) -> Result<RV, RedisError>

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>

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>

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>

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>

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>

Insert an element after another element in a list. Redis Docs
Source§

fn llen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

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>

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>

Pops count elements from the first non-empty list key from the list of provided key names. Redis Docs
Source§

fn lpop<'a, K, RV>( &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 more
Source§

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>

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>

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>

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>

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>

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>

Sets the list element at index to value Redis Docs
Source§

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>

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>

Removes and returns the up to count last elements of the list stored at key Read more
Source§

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>

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>

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>

Add one or more members to a set. Redis Docs
Source§

fn scard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Get the number of members in a set. Redis Docs
Source§

fn sdiff<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>

Subtract multiple sets. Redis Docs
Source§

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>

Intersect multiple sets. Redis Docs
Source§

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>

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>

Determine if given values are members of a set. Redis Docs
Source§

fn smembers<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

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>

Move a member from one set to another. Redis Docs
Source§

fn spop<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Remove and return a random member from a set. Redis Docs
Source§

fn srandmember<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Get one random member from a set. Redis Docs
Source§

fn srandmember_multiple<'a, K, RV>( &mut self, key: K, count: isize, ) -> Result<RV, RedisError>

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>

Remove one or more members from a set. Redis Docs
Source§

fn sunion<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>

Add multiple sets. Redis Docs
Source§

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>

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>

Add multiple members to a sorted set, or update its score if it already exists. Redis Docs
Source§

fn zadd_options<'a, K, S, M, RV>( &mut self, key: K, member: M, score: S, options: &'a SortedSetAddOptions, ) -> Result<RV, RedisError>

Add one member to a sorted set, or update its score if it already exists. Redis Docs
Source§

fn zadd_multiple_options<'a, K, S, M, RV>( &mut self, key: K, items: &'a [(S, M)], options: &'a SortedSetAddOptions, ) -> 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>

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>

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>

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>

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>

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>

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>

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 Docs
Source§

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 Docs
Source§

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 Docs
Source§

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>

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>

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>

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>

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>

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>

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>

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>

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>

Return up to count random members in a sorted set (or 1 if count == None) Redis Docs
Source§

fn zrandmember_withscores<'a, K, RV>( &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, RV>( &mut self, key: K, start: isize, stop: isize, ) -> Result<RV, RedisError>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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 Docs
Source§

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 Docs
Source§

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 Docs
Source§

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>

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>

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>

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>

Posts a message to the given sharded channel. Redis Docs
Source§

fn object_encoding<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Returns the encoding of a key. Redis Docs
Source§

fn object_idletime<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

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>

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>

Returns the reference count of a key. Redis Docs
Source§

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,

Returns the ID of the current connection. Redis Docs
Source§

fn client_setname<'a, K, RV>( &mut self, connection_name: K, ) -> Result<RV, RedisError>

Command assigns a name to the current connection. Redis Docs
Source§

fn acl_load<'a, RV>(&mut self) -> Result<RV, RedisError>
where RV: FromRedisValue,

Available on crate feature acl only.
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,

Available on crate feature acl only.
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,

Available on crate feature acl only.
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,

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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,

Available on crate feature acl only.
Shows the available ACL categories. Redis Docs
Source§

fn acl_cat_categoryname<'a, K, RV>( &mut self, categoryname: K, ) -> Result<RV, RedisError>

Available on crate feature acl only.
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,

Available on crate feature acl only.
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,

Available on crate feature acl only.
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,

Available on crate feature acl only.
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,

Available on crate feature acl only.
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,

Available on crate feature acl only.
Clears the ACL log. Redis Docs
Source§

fn acl_help<'a, RV>(&mut self) -> Result<RV, RedisError>
where RV: FromRedisValue,

Available on crate feature acl only.
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>

Available on crate feature geospatial only.
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>

Available on crate feature geospatial only.
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>

Available on crate feature geospatial only.
Return valid Geohash strings representing the position of one or more members of the geospatial index represented by the sorted set at key. Read more
Source§

fn geo_pos<'a, K, M, RV>( &mut self, key: K, members: M, ) -> Result<RV, RedisError>

Available on crate feature geospatial only.
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>

Available on crate feature geospatial only.
Return the members of a sorted set populated with geospatial information using geo_add, which are within the borders of the area specified with the center location and the maximum distance from the center (the radius). Read more
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>

Available on crate feature geospatial only.
Retrieve members selected by distance with the center of member. The member itself is always contained in the results. Redis Docs
Source§

fn xack<'a, K, G, I, RV>( &mut self, key: K, group: G, ids: &'a [I], ) -> Result<RV, RedisError>

Available on crate feature streams only.
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>

Available on crate feature streams only.
Add a stream message by key. Use * as the id for the current timestamp. Read more
Source§

fn xadd_map<'a, K, ID, BTM, RV>( &mut self, key: K, id: ID, map: BTM, ) -> Result<RV, RedisError>

Available on crate feature streams only.
BTreeMap variant for adding a stream message by key. Use * as the id for the current timestamp. Read more
Source§

fn xadd_options<'a, K, ID, I, RV>( &mut self, key: K, id: ID, items: I, options: &'a StreamAddOptions, ) -> Result<RV, RedisError>

Available on crate feature streams only.
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>

Available on crate feature streams only.
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>

Available on crate feature streams only.
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>

Available on crate feature streams only.
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>

Available on crate feature streams only.
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>

Available on crate feature streams only.
This is the optional arguments version for claiming unacked, pending messages currently checked out by another consumer. Read more
Source§

fn xdel<'a, K, ID, RV>( &mut self, key: K, ids: &'a [ID], ) -> Result<RV, RedisError>

Available on crate feature streams only.
Deletes a list of ids for a given stream key. Read more
Source§

fn xdel_ex<'a, K, ID, RV>( &mut self, key: K, ids: &'a [ID], options: StreamDeletionPolicy, ) -> Result<RV, RedisError>

Available on crate feature streams only.
An extension of the Streams XDEL command that provides finer control over how message entries are deleted with respect to consumer groups.
Source§

fn xack_del<'a, K, G, ID, RV>( &mut self, key: K, group: G, ids: &'a [ID], options: StreamDeletionPolicy, ) -> Result<RV, RedisError>

Available on crate feature streams only.
A combination of XACK and XDEL that acknowledges and attempts to delete a list of ids for a given stream key and consumer group.
Source§

fn xgroup_create<'a, K, G, ID, RV>( &mut self, key: K, group: G, id: ID, ) -> Result<RV, RedisError>

Available on crate feature streams only.
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 more
Source§

fn xgroup_createconsumer<'a, K, G, C, RV>( &mut self, key: K, group: G, consumer: C, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This creates a consumer explicitly (vs implicit via XREADGROUP) for given stream `key. Read more
Source§

fn xgroup_create_mkstream<'a, K, G, ID, RV>( &mut self, key: K, group: G, id: ID, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This is the alternate version for creating a consumer group which makes the stream if it doesn’t exist. Read more
Source§

fn xgroup_setid<'a, K, G, ID, RV>( &mut self, key: K, group: G, id: ID, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Alter which id you want consumers to begin reading from an existing consumer group. Read more
Source§

fn xgroup_destroy<'a, K, G, RV>( &mut self, key: K, group: G, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Destroy an existing consumer group for a given stream key Read more
Source§

fn xgroup_delconsumer<'a, K, G, C, RV>( &mut self, key: K, group: G, consumer: C, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This deletes a consumer from an existing consumer group for given stream `key. Read more
Source§

fn xinfo_consumers<'a, K, G, RV>( &mut self, key: K, group: G, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This returns all info details about which consumers have read messages for given consumer group. Take note of the StreamInfoConsumersReply return type. Read more
Source§

fn xinfo_groups<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Available on crate feature streams only.
Returns all consumer groups created for a given stream key. Take note of the StreamInfoGroupsReply return type. Read more
Source§

fn xinfo_stream<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Available on crate feature streams only.
Returns info about high-level stream details (first & last message id, length, number of groups, etc.) Take note of the StreamInfoStreamReply return type. Read more
Source§

fn xinfo_stream_with_idempotency<'a, K, RV>( &mut self, key: K, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Returns stream info with idempotency tracking statistics (Redis 8.6+). Read more
Source§

fn xlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Available on crate feature streams only.
Returns the number of messages for a given stream key. Read more
Source§

fn xpending<'a, K, G, RV>(&mut self, key: K, group: G) -> Result<RV, RedisError>

Available on crate feature streams only.
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 more
Source§

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>

Available on crate feature streams only.
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>

Available on crate feature streams only.
An alternate version of xpending_count which filters by consumer name. Read more
Source§

fn xrange<'a, K, S, E, RV>( &mut self, key: K, start: S, end: E, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Returns a range of messages in a given stream key. Read more
Source§

fn xrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Available on crate feature streams only.
A helper method for automatically returning all messages in a stream by key. Use with caution! Read more
Source§

fn xrange_count<'a, K, S, E, C, RV>( &mut self, key: K, start: S, end: E, count: C, ) -> Result<RV, RedisError>

Available on crate feature streams only.
A method for paginating a stream by key. Read more
Source§

fn xread<'a, K, ID, RV>( &mut self, keys: &'a [K], ids: &'a [ID], ) -> Result<RV, RedisError>

Available on crate feature streams only.
Read a list of ids 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 more
Source§

fn xread_options<'a, K, ID, RV>( &mut self, keys: &'a [K], ids: &'a [ID], options: &'a StreamReadOptions, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This method handles setting optional arguments for XREAD or XREADGROUP Redis commands. Read more
Source§

fn xrevrange<'a, K, E, S, RV>( &mut self, key: K, end: E, start: S, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This is the reverse version of xrange. The same rules apply for start and end here. Read more
Source§

fn xrevrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>

Available on crate feature streams only.
This is the reverse version of xrange_all. The same rules apply for start and end here. Read more
Source§

fn xrevrange_count<'a, K, E, S, C, RV>( &mut self, key: K, end: E, start: S, count: C, ) -> Result<RV, RedisError>

Available on crate feature streams only.
This is the reverse version of xrange_count. The same rules apply for start and end here. Read more
Source§

fn xtrim<'a, K, RV>( &mut self, key: K, maxlen: StreamMaxlen, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Trim a stream key to a MAXLEN count. Read more
Source§

fn xtrim_options<'a, K, RV>( &mut self, key: K, options: &'a StreamTrimOptions, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Trim a stream key with full options Read more
Source§

fn xcfgset<'a, K, RV>( &mut self, key: K, options: &'a StreamConfigOptions, ) -> Result<RV, RedisError>

Available on crate feature streams only.
Configure idempotency parameters for a stream Read more
Source§

fn load_script<'a, RV>(&mut self, script: &'a Script) -> Result<RV, RedisError>
where RV: FromRedisValue,

Available on crate feature script only.
Load a script. Read more
Source§

fn invoke_script<'a, RV>( &mut self, invocation: &'a ScriptInvocation<'a>, ) -> Result<RV, RedisError>
where RV: FromRedisValue,

Available on crate feature script only.
Invoke a prepared script. Read more
Source§

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,

Deletes all the keys of all databases with options Read more
Source§

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,

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,

Incrementally iterate the keys space.
Source§

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>

Incrementally iterate the keys space for keys matching a pattern.
Source§

fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>

Incrementally iterate hash fields and associated values.
Source§

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>

Incrementally iterate set elements.
Source§

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>

Incrementally iterate sorted set elements.
Source§

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 T
where C: ConnectionLike, T: DerefMut<Target = C>,

Source§

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.
Source§

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>

Sends a Cmd into the TCP socket and reads a single response from it.
Source§

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.
Source§

fn supports_pipelining(&self) -> bool

Source§

fn check_connection(&mut self) -> bool

Check that all connections it has are available (PING internally).
Source§

fn is_open(&self) -> bool

Returns the connection status. Read more
Source§

impl<R> CryptoRng for R
where R: TryCryptoRng<Error = Infallible> + ?Sized,

Source§

impl<T> CryptoRng for T
where T: DerefMut, <T as Deref>::Target: CryptoRng,

Source§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T, S> Handler<IntoResponseHandler, S> for T
where T: IntoResponse + Clone + Send + Sync + 'static,

Source§

type Future = Ready<Response<Body>>

The type of future calling this handler returns.
Source§

fn call( self, _req: Request<Body>, _state: S, ) -> <T as Handler<IntoResponseHandler, S>>::Future

Call the handler with the given request.
Source§

fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
where L: Layer<HandlerService<Self, T, S>> + Clone, <L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,

Apply a tower::Layer to the handler. Read more
Source§

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Convert the handler into a Service by providing the state
Source§

impl<H, T> HandlerWithoutStateExt<T> for H
where H: Handler<T, ()>,

Source§

fn into_service(self) -> HandlerService<H, T, ()>

Convert the handler into a Service and no state.
Source§

fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>

Convert the handler into a MakeService and no state. Read more
Source§

fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>

Available on crate feature tokio only.
Convert the handler into a MakeService which stores information about the incoming connection and has no state. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Paint for T
where T: ?Sized,

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<R> Rng for R
where R: RngCore + ?Sized,

Source§

fn random<T>(&mut self) -> T

Return a random value via the StandardUniform distribution. Read more
Source§

fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>

Return an iterator over random variates Read more
Source§

fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Source§

fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
Source§

fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being true. Read more
Source§

fn sample<T, D>(&mut self, distr: D) -> T
where 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,

Create an iterator that generates values using the given distribution. Read more
Source§

fn fill<T>(&mut self, dest: &mut T)
where T: Fill + ?Sized,

Fill any type implementing Fill with random data Read more
Source§

fn gen<T>(&mut self) -> 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) -> T
where T: SampleUniform, R: SampleRange<T>,

👎Deprecated since 0.9.0:

Renamed to random_range

Source§

fn gen_bool(&mut self, p: f64) -> bool

👎Deprecated since 0.9.0:

Renamed to random_bool

Alias for Rng::random_bool.
Source§

fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool

👎Deprecated since 0.9.0:

Renamed to random_ratio

Source§

impl<R> Rng for R
where R: TryRng<Error = Infallible> + ?Sized,

Source§

fn next_u32(&mut self) -> u32

Return the next random u32.
Source§

fn next_u64(&mut self) -> u64

Return the next random u64.
Source§

fn fill_bytes(&mut self, dst: &mut [u8])

Fill dest with random data. Read more
Source§

impl<T> RngCore for T
where T: DerefMut, <T as Deref>::Target: RngCore,

Source§

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
Source§

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
Source§

fn fill_bytes(&mut self, dst: &mut [u8])

Fill dest with random data. Read more
Source§

impl<R> RngCore for R
where R: Rng,

Source§

impl<R> RngExt for R
where R: Rng + ?Sized,

Source§

fn random<T>(&mut self) -> T

Return a random value via the StandardUniform distribution. Read more
Source§

fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>

Return an iterator over random variates Read more
Source§

fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Source§

fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
Source§

fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being true. Read more
Source§

fn sample<T, D>(&mut self, distr: D) -> T
where 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,

Create an iterator that generates values using the given distribution. Read more
Source§

fn fill<T>(&mut self, dest: &mut [T])
where T: Fill,

Fill any type implementing Fill with random data Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<R> TryCryptoRng for R
where R: CryptoRng + ?Sized,

Source§

impl<R> TryCryptoRng for R
where R: DerefMut, <R as Deref>::Target: TryCryptoRng,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<R> TryRng for R
where R: DerefMut, <R as Deref>::Target: TryRng,

Source§

type Error = <<R as Deref>::Target as TryRng>::Error

The type returned in the event of a RNG error. Read more
Source§

fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>

Return the next random u32.
Source§

fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>

Return the next random u64.
Source§

fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>

Fill dst entirely with random data.
Source§

impl<R> TryRngCore for R
where R: TryRng,

Source§

type Error = <R as TryRng>::Error

👎Deprecated since 0.10.0:

use TryRng instead

Error type.
Source§

impl<R> TryRngCore for R
where R: RngCore + ?Sized,

Source§

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>

Return the next random u32.
Source§

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>

Fill dest entirely with random data.
Source§

fn unwrap_err(self) -> UnwrapErr<Self>
where Self: Sized,

Wrap RNG with the UnwrapErr wrapper.
Source§

fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>

Wrap RNG with the UnwrapMut wrapper.
Source§

fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>
where Self: Sized,

Available on crate feature std only.
Convert an RngCore to a RngReadAdapter.
Source§

impl<T> TypedCommands for T
where T: ConnectionLike,

Source§

fn get<'a, K>(&'a mut self, key: K) -> Result<Option<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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 Docs
Source§

fn mget<'a, K>(&'a mut self, key: K) -> Result<Vec<Option<String>>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Get values of keys Redis Docs
Source§

fn keys<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Gets all keys matching pattern Redis Docs
Source§

fn set<'a, K, V>(&'a mut self, key: K, value: V) -> Result<(), RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

Set the string value of a key with options. Redis Docs
Source§

fn mset<'a, K, V>(&'a mut self, items: &'a [(K, V)]) -> Result<(), RedisError>
where K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

Sets multiple keys to their values failing if at least one already exists. Redis Docs
Source§

fn mset_ex<'a, K, V>( &'a mut self, items: &'a [(K, V)], options: MSetOptions, ) -> Result<bool, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

Sets the given keys to their respective values. This command is an extension of the MSETNX that adds expiration and XX options. Redis Docs
Source§

fn getset<'a, K, V>( &'a mut self, key: K, value: V, ) -> Result<Option<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

Delete one or more keys. Returns the number of keys deleted. Redis Docs
Source§

fn del_ex<'a, K>( &'a mut self, key: K, value_comparison: ValueComparison, ) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Conditionally removes the specified key. A key is ignored if it does not exist. IFEQ match-value - Delete the key only if its value is equal to match-value IFNE match-value - Delete the key only if its value is not equal to match-value IFDEQ match-digest - Delete the key only if the digest of its value is equal to match-digest IFDNE match-digest - Delete the key only if the digest of its value is not equal to match-digest Redis Docs
Source§

fn digest<'a, K>(&'a mut self, key: K) -> Result<Option<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get the hex signature of the value stored in the specified key. For the digest, Redis will use XXH3 Redis Docs
Source§

fn exists<'a, K>(&'a mut self, key: K) -> Result<bool, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Determine if a key exists. Redis Docs
Source§

fn key_type<'a, K>(&'a mut self, key: K) -> Result<ValueType, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Determine the type of key. Redis Docs
Source§

fn expire<'a, K>(&'a mut self, key: K, seconds: i64) -> Result<bool, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get the absolute Unix expiration timestamp in seconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn pexpire_time<'a, K>( &'a mut self, key: K, ) -> Result<IntegerReplyOrNoOp, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get the absolute Unix expiration timestamp in milliseconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn persist<'a, K>(&'a mut self, key: K) -> Result<bool, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get the time to live for a key in seconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn pttl<'a, K>(&'a mut self, key: K) -> Result<IntegerReplyOrNoOp, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get the time to live for a key in milliseconds. Returns ExistsButNotRelevant if key exists but has no expiration time. Redis Docs
Source§

fn get_ex<'a, K>( &'a mut self, key: K, expire_at: Expiry, ) -> Result<Option<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, KDst: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a, N: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, N: ToSingleRedisArg + Send + Sync + 'a,

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
Unlink one or more keys. This is a non-blocking version of DEL. Returns number of keys unlinked. Redis Docs
Source§

fn append<'a, K, V>(&'a mut self, key: K, value: V) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn bit_or<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn bit_xor<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn bit_not<'a, D, S>( &'a mut self, dstkey: D, srckey: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToSingleRedisArg + Send + Sync + 'a,

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
Source§

fn bit_diff<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

DIFF(X, Y1, Y2, …)
Perform a set difference to extract the members of X that are not members of any of Y1, Y2,….
Logical representation: X ∧ ¬(Y1 ∨ Y2 ∨ …)
Redis Docs
Source§

fn bit_diff1<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

DIFF1(X, Y1, Y2, …) (Relative complement difference)
Perform a relative complement set difference to extract the members of one or more of Y1, Y2,… that are not members of X.
Logical representation: ¬X ∧ (Y1 ∨ Y2 ∨ …)
Redis Docs
Source§

fn bit_and_or<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

ANDOR(X, Y1, Y2, …)
Perform an “intersection of union(s)” operation to extract the members of X that are also members of one or more of Y1, Y2,….
Logical representation: X ∧ (Y1 ∨ Y2 ∨ …)
Redis Docs
Source§

fn bit_one<'a, D, S>( &'a mut self, dstkey: D, srckeys: S, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

ONE(X, Y1, Y2, …)
Perform an “exclusive membership” operation to extract the members of exactly one of X, Y1, Y2, ….
Logical representation: (X ∨ Y1 ∨ Y2 ∨ …) ∧ ¬((X ∧ Y1) ∨ (X ∧ Y2) ∨ (Y1 ∧ Y2) ∨ (Y1 ∧ Y3) ∨ …)
Redis Docs
Source§

fn strlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToSingleRedisArg + Send + Sync + 'a,

Gets a single (or multiple) fields from a hash.
Source§

fn hmget<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Gets multiple fields from a hash. Redis Docs
Source§

fn hget_ex<'a, K, F>( &'a mut self, key: K, fields: F, expire_at: Expiry, ) -> Result<Vec<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Get the value of one or more fields of a given hash key, and optionally set their expiration Redis Docs
Source§

fn hdel<'a, K, F>(&'a mut self, key: K, field: F) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Get and delete the value of one or more fields of a given hash key Redis Docs
Source§

fn hset<'a, K, F, V>( &'a mut self, key: K, field: F, value: V, ) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + 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: ToSingleRedisArg + 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
Source§

fn hset_nx<'a, K, F, V>( &'a mut self, key: K, field: F, value: V, ) -> Result<bool, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + 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: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, F: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Get one or more fields’ TTL in seconds. Redis Docs
Source§

fn hpttl<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Get one or more fields’ TTL in milliseconds. Redis Docs
Source§

fn hexpire<'a, K, F>( &'a mut self, key: K, seconds: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn hexpire_at<'a, K, F>( &'a mut self, key: K, ts: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Set the expiration for one or more fields as a UNIX timestamp 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 a time in the past. Errors if provided key exists but is not a hash. Redis Docs
Source§

fn hexpire_time<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Returns the absolute Unix expiration timestamp in seconds. Redis Docs
Source§

fn hpersist<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Remove the expiration from a key. Returns 1 if the expiration was removed. Redis Docs
Source§

fn hpexpire<'a, K, F>( &'a mut self, key: K, milliseconds: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn hpexpire_at<'a, K, F>( &'a mut self, key: K, ts: i64, opt: ExpireOption, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn hpexpire_time<'a, K, F>( &'a mut self, key: K, fields: F, ) -> Result<Vec<IntegerReplyOrNoOp>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a,

Returns the absolute Unix expiration timestamp in seconds. Redis Docs
Source§

fn hkeys<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Gets all the keys in a hash. Redis Docs
Source§

fn hvals<'a, K>(&'a mut self, key: K) -> Result<Vec<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Gets all the values in a hash. Redis Docs
Source§

fn hgetall<'a, K>( &'a mut self, key: K, ) -> Result<HashMap<String, String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Gets all the fields and values in a hash. Redis Docs
Source§

fn hlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where S: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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
Source§

fn blpop<'a, K>( &'a mut self, key: K, timeout: f64, ) -> Result<Option<[String; 2]>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where S: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, P: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, P: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where S: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

Pops count elements from the first non-empty list key from the list of provided key names. Redis Docs
Source§

fn lpop<'a, RV, K>( &'a mut self, key: K, count: Option<NonZero<usize>>, ) -> Result<RV, RedisError>
where RV: FromRedisValue, K: ToSingleRedisArg + Send + Sync + 'a,

Removes and returns the up to count first elements of the list stored at key. Read more
Source§

fn lpos<'a, RV, K, V>( &'a mut self, key: K, value: V, options: LposOptions, ) -> Result<RV, RedisError>
where RV: FromRedisValue, K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToSingleRedisArg + Send + Sync + 'a,

Sets the list element at index to value Redis Docs
Source§

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where RV: FromRedisValue, K: ToSingleRedisArg + Send + Sync + 'a,

Removes and returns the up to count last elements of the list stored at key Read more
Source§

fn rpoplpush<'a, K, D>( &'a mut self, key: K, dstkey: D, ) -> Result<Option<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

Add one or more members to a set. Redis Docs
Source§

fn scard<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get the number of members in a set. Redis Docs
Source§

fn sdiff<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Subtract multiple sets. Redis Docs
Source§

fn sdiffstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

Intersect multiple sets. Redis Docs
Source§

fn sinterstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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>
where RV: FromRedisValue, K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Get one random member from a set. Redis Docs
Source§

fn srandmember_multiple<'a, K>( &'a mut self, key: K, count: isize, ) -> Result<Vec<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

Remove one or more members from a set. Redis Docs
Source§

fn sunion<'a, K>(&'a mut self, keys: K) -> Result<HashSet<String>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Add multiple sets. Redis Docs
Source§

fn sunionstore<'a, D, K>( &'a mut self, dstkey: D, keys: K, ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, S: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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: ToSingleRedisArg + 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 zadd_options<'a, K, S, M>( &'a mut self, key: K, member: M, score: S, options: &'a SortedSetAddOptions, ) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, S: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a,

Add one member to a sorted set, or update its score if it already exists. Redis Docs
Source§

fn zadd_multiple_options<'a, K, S, M>( &'a mut self, key: K, items: &'a [(S, M)], options: &'a SortedSetAddOptions, ) -> Result<usize, RedisError>
where K: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, D: ToSingleRedisArg + 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>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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: ToSingleRedisArg + 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 Docs
Source§

fn zinterstore_min_weights<'a, D, K, W>( &'a mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + 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 Docs
Source§

fn zinterstore_max_weights<'a, D, K, W>( &'a mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + 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 Docs
Source§

fn zlexcount<'a, K, M, MM>( &'a mut self, key: K, min: M, max: MM, ) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where RV: FromRedisValue, K: ToSingleRedisArg + Send + Sync + 'a,

Return up to count random members in a sorted set (or 1 if count == None) Redis Docs
Source§

fn zrandmember_withscores<'a, RV, K>( &'a mut self, key: K, count: isize, ) -> Result<RV, RedisError>
where RV: FromRedisValue, K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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: ToSingleRedisArg + Send + Sync + 'a, MM: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + 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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, K: ToRedisArgs + Send + Sync + 'a,

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: ToSingleRedisArg + 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 Docs
Source§

fn zunionstore_min_weights<'a, D, K, W>( &'a mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + 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 Docs
Source§

fn zunionstore_max_weights<'a, D, K, W>( &'a mut self, dstkey: D, keys: &'a [(K, W)], ) -> Result<usize, RedisError>
where D: ToSingleRedisArg + 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 Docs
Source§

fn pfadd<'a, K, E>(&'a mut self, key: K, element: E) -> Result<bool, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, E: ToRedisArgs + Send + Sync + 'a,

Adds the specified elements to the specified HyperLogLog. Redis Docs
Source§

fn pfcount<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

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>
where D: ToSingleRedisArg + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, E: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a, E: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Returns the encoding of a key. Redis Docs
Source§

fn object_idletime<'a, K>( &'a mut self, key: K, ) -> Result<Option<usize>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Returns the reference count of a key. Redis Docs
Source§

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>

Returns the ID of the current connection. Redis Docs
Source§

fn client_setname<'a, K>( &'a mut self, connection_name: K, ) -> Result<(), RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Command assigns a name to the current connection. Redis Docs
Source§

fn acl_load<'a>(&'a mut self) -> Result<(), RedisError>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
Shows the currently active ACL rules in the Redis server. Redis Docs
Source§

fn acl_users<'a>(&'a mut self) -> Result<Vec<String>, RedisError>

Available on crate feature acl only.
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<AclInfo>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature acl only.
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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature acl only.
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>
where K: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature acl only.
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>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature acl only.
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: ToSingleRedisArg + Send + Sync + 'a, C: ToSingleRedisArg + Send + Sync + 'a, A: ToRedisArgs + Send + Sync + 'a,

Available on crate feature acl only.
Simulate the execution of a given command by a given user. Redis Docs
Source§

fn acl_cat<'a>(&'a mut self) -> Result<HashSet<String>, RedisError>

Available on crate feature acl only.
Shows the available ACL categories. Redis Docs
Source§

fn acl_cat_categoryname<'a, K>( &'a mut self, categoryname: K, ) -> Result<HashSet<String>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature acl only.
Shows all the Redis commands in the specified category. Redis Docs
Source§

fn acl_genpass<'a>(&'a mut self) -> Result<String, RedisError>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
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>

Available on crate feature acl only.
Shows a list of recent ACL security events Redis Docs
Source§

fn acl_log_reset<'a>(&'a mut self) -> Result<(), RedisError>

Available on crate feature acl only.
Clears the ACL log. Redis Docs
Source§

fn acl_help<'a>(&'a mut self) -> Result<Vec<String>, RedisError>

Available on crate feature acl only.
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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

Available on crate feature geospatial only.
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<f64>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, M1: ToSingleRedisArg + Send + Sync + 'a, M2: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature geospatial only.
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>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

Available on crate feature geospatial only.
Return valid Geohash strings representing the position of one or more members of the geospatial index represented by the sorted set at key. Read more
Source§

fn geo_pos<'a, K, M>( &'a mut self, key: K, members: M, ) -> Result<Vec<Option<Coord<f64>>>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToRedisArgs + Send + Sync + 'a,

Available on crate feature geospatial only.
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>( &'a mut self, key: K, longitude: f64, latitude: f64, radius: f64, unit: Unit, options: RadiusOptions, ) -> Result<Vec<RadiusSearchResult>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature geospatial only.
Return the members of a sorted set populated with geospatial information using geo_add, which are within the borders of the area specified with the center location and the maximum distance from the center (the radius). Read more
Source§

fn geo_radius_by_member<'a, K, M>( &'a mut self, key: K, member: M, radius: f64, unit: Unit, options: RadiusOptions, ) -> Result<Vec<RadiusSearchResult>, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, M: ToSingleRedisArg + Send + Sync + 'a,

Available on crate feature geospatial only.
Retrieve members selected by distance with the center of member. The member itself is always contained in the results. Redis Docs
Source§

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,

Available on crate feature streams only.
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,

Available on crate feature streams only.
Add a stream message by key. Use * as the id for the current timestamp. Read more
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,

Available on crate feature streams only.
BTreeMap variant for adding a stream message by key. Use * as the id for the current timestamp. Read more
Source§

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,

Available on crate feature streams only.
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: ToSingleRedisArg + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a, F: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
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: ToSingleRedisArg + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a, BTM: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
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<StreamAutoClaimReply, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, MIT: ToRedisArgs + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
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<StreamClaimReply, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, MIT: ToRedisArgs + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
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: ToSingleRedisArg + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, MIT: ToRedisArgs + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
This is the optional arguments version for claiming unacked, pending messages currently checked out by another consumer. Read more
Source§

fn xdel<'a, K, ID>( &'a mut self, key: K, ids: &'a [ID], ) -> Result<usize, RedisError>
where K: ToSingleRedisArg + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Deletes a list of ids for a given stream key. Read more
Source§

fn xdel_ex<'a, K, ID>( &'a mut self, key: K, ids: &'a [ID], options: StreamDeletionPolicy, ) -> Result<Vec<XDelExStatusCode>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
An extension of the Streams XDEL command that provides finer control over how message entries are deleted with respect to consumer groups.
Source§

fn xack_del<'a, K, G, ID>( &'a mut self, key: K, group: G, ids: &'a [ID], options: StreamDeletionPolicy, ) -> Result<Vec<XAckDelStatusCode>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
A combination of XACK and XDEL that acknowledges and attempts to delete a list of ids for a given stream key and consumer group.
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,

Available on crate feature streams only.
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 more
Source§

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,

Available on crate feature streams only.
This creates a consumer explicitly (vs implicit via XREADGROUP) for given stream `key. Read more
Source§

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,

Available on crate feature streams only.
This is the alternate version for creating a consumer group which makes the stream if it doesn’t exist. Read more
Source§

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,

Available on crate feature streams only.
Alter which id you want consumers to begin reading from an existing consumer group. Read more
Source§

fn xgroup_destroy<'a, K, G>( &'a mut self, key: K, group: G, ) -> Result<bool, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Destroy an existing consumer group for a given stream key Read more
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,

Available on crate feature streams only.
This deletes a consumer from an existing consumer group for given stream `key. Read more
Source§

fn xinfo_consumers<'a, K, G>( &'a mut self, key: K, group: G, ) -> Result<StreamInfoConsumersReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
This returns all info details about which consumers have read messages for given consumer group. Take note of the StreamInfoConsumersReply return type. Read more
Source§

fn xinfo_groups<'a, K>( &'a mut self, key: K, ) -> Result<StreamInfoGroupsReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Returns all consumer groups created for a given stream key. Take note of the StreamInfoGroupsReply return type. Read more
Source§

fn xinfo_stream<'a, K>( &'a mut self, key: K, ) -> Result<StreamInfoStreamReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Returns info about high-level stream details (first & last message id, length, number of groups, etc.) Take note of the StreamInfoStreamReply return type. Read more
Source§

fn xinfo_stream_with_idempotency<'a, K>( &'a mut self, key: K, ) -> Result<StreamInfoStreamReplyWithIdempotency, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Returns stream info with idempotency tracking statistics (Redis 8.6+). Read more
Source§

fn xlen<'a, K>(&'a mut self, key: K) -> Result<usize, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Returns the number of messages for a given stream key. Read more
Source§

fn xpending<'a, K, G>( &'a mut self, key: K, group: G, ) -> Result<StreamPendingReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, G: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
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 more
Source§

fn xpending_count<'a, K, G, S, E, C>( &'a mut self, key: K, group: G, start: S, end: E, count: C, ) -> Result<StreamPendingCountReply, RedisError>
where 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,

Available on crate feature streams only.
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>( &'a mut self, key: K, group: G, start: S, end: E, count: C, consumer: CN, ) -> Result<StreamPendingCountReply, RedisError>
where 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,

Available on crate feature streams only.
An alternate version of xpending_count which filters by consumer name. Read more
Source§

fn xrange<'a, K, S, E>( &'a mut self, key: K, start: S, end: E, ) -> Result<StreamRangeReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a, E: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Returns a range of messages in a given stream key. Read more
Source§

fn xrange_all<'a, K>( &'a mut self, key: K, ) -> Result<StreamRangeReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
A helper method for automatically returning all messages in a stream by key. Use with caution! Read more
Source§

fn xrange_count<'a, K, S, E, C>( &'a mut self, key: K, start: S, end: E, count: C, ) -> Result<StreamRangeReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a, E: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
A method for paginating a stream by key. Read more
Source§

fn xread<'a, K, ID>( &'a mut self, keys: &'a [K], ids: &'a [ID], ) -> Result<Option<StreamReadReply>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Read a list of ids 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 more
Source§

fn xread_options<'a, K, ID>( &'a mut self, keys: &'a [K], ids: &'a [ID], options: &'a StreamReadOptions, ) -> Result<Option<StreamReadReply>, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, ID: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
This method handles setting optional arguments for XREAD or XREADGROUP Redis commands. Read more
Source§

fn xrevrange<'a, K, E, S>( &'a mut self, key: K, end: E, start: S, ) -> Result<StreamRangeReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, E: ToRedisArgs + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
This is the reverse version of xrange. The same rules apply for start and end here. Read more
Source§

fn xrevrange_all<'a, K>( &'a mut self, key: K, ) -> Result<StreamRangeReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
This is the reverse version of xrange_all. The same rules apply for start and end here. Read more
Source§

fn xrevrange_count<'a, K, E, S, C>( &'a mut self, key: K, end: E, start: S, count: C, ) -> Result<StreamRangeReply, RedisError>
where K: ToRedisArgs + Send + Sync + 'a, E: ToRedisArgs + Send + Sync + 'a, S: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
This is the reverse version of xrange_count. The same rules apply for start and end here. Read more
Source§

fn xtrim<'a, K>( &'a mut self, key: K, maxlen: StreamMaxlen, ) -> Result<usize, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Trim a stream key to a MAXLEN count. Read more
Source§

fn xtrim_options<'a, K>( &'a mut self, key: K, options: &'a StreamTrimOptions, ) -> Result<usize, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Trim a stream key with full options Read more
Source§

fn xcfgset<'a, K>( &'a mut self, key: K, options: &'a StreamConfigOptions, ) -> Result<String, RedisError>
where K: ToRedisArgs + Send + Sync + 'a,

Available on crate feature streams only.
Configure idempotency parameters for a stream Read more
Source§

fn load_script<'a, RV>( &'a mut self, script: &'a Script, ) -> Result<RV, RedisError>
where RV: FromRedisValue,

Available on crate feature script only.
Load a script. Read more
Source§

fn invoke_script<'a, RV>( &'a mut self, invocation: &'a ScriptInvocation<'a>, ) -> Result<RV, RedisError>
where RV: FromRedisValue,

Available on crate feature script only.
Invoke a prepared script. Read more
Source§

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>

Deletes all the keys of all databases with options Read more
Source§

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>

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,

Incrementally iterate the keys space.
Source§

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>

Incrementally iterate the keys space for keys matching a pattern.
Source§

fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>

Incrementally iterate hash fields and associated values.
Source§

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>

Incrementally iterate set elements.
Source§

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>

Incrementally iterate sorted set elements.
Source§

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>

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,

Get values from Redis and convert them to Option<isize>s.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more