Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

pub async fn connect(config: impl IntoConfig) -> Result<Self>

Connects asynchronously to the Redis server.

§Errors

Any Redis driver Error that occurs during the connection operation

Source

pub fn config(&self) -> &Config

The configuration this client was built from.

A pool wrapper, a health checker or a telemetry exporter can then ask a client what it was configured with instead of being handed the Config separately. It is the value after parsing, so a client built from a URI reads back every default the URI left unsaid.

§Example
use rustis::{client::{Client, ServerConfig}, Result};

let client = Client::connect("127.0.0.1:6379").await?;
assert!(matches!(client.config().server, ServerConfig::Standalone { .. }));
Source

pub fn stats(&self) -> ClientStats

What the connection is doing right now: queue depth, shed commands, reconnections.

This is the other half of BackpressureConfig: the budget is sized against queued_bytes_high_water, and whether it is being hit is shed_commands. Every clone of a client reads the same counters, one connection having one queue.

§Example
use rustis::{client::Client, Result};

let client = Client::connect("127.0.0.1:6379").await?;
assert_eq!(0, client.stats().shed_commands);
Source

pub fn is_connected(&self) -> bool

Whether the link to the server is up.

false covers a link that is down and one that is backing off between attempts, both of which recover on their own. The state that does not is is_terminated.

Source

pub fn server_version(&self) -> Option<Arc<str>>

The server version the handshake reported, refreshed at every reconnection.

None for a cluster: its nodes have versions of their own, so one string would have to pick a node and hide the rest. Reading this replaces re-issuing HELLO to branch on a version-dependent behaviour.

Source

pub fn is_terminated(&self) -> bool

Whether this client is finished for good.

The network task behind the client ends when the connection is gone beyond recovery: a non-zero ReconnectionConfig budget exhausted, or the last handle dropped. Every command issued afterwards fails, including long after the server has come back, and the only recovery is a new client from Client::connect.

This is what a liveness probe reads: the state is otherwise invisible, a process staying alive and serving traffic it cannot answer. Keep the default budget of 0 in a long-lived service and it never happens.

It reports the task, not the link. false says nothing about a connection that is merely idle, disconnected, or backing off between attempts — those all recover on their own.

§Example
use rustis::{client::Client, Result};

let client = Client::connect("127.0.0.1:6379").await?;
assert!(!client.is_terminated());
Source

pub async fn close(self) -> Result<CloseOutcome>

Ends the connection, if this handle is the last one on it.

A Client is a handle: several clones share one connection, one queue and one network task. Only the last handle can end them, so the outcome is what the call reports: CloseOutcome::Closed means the send channel was closed and the network task has finished, and StillShared means another handle was still holding it and nothing was shut down here. Ok alone is not the answer, which is why the outcome is returned rather than discarded: a shutdown path that treats Ok(()) as “drained” would be wrong for every clone but one.

Awaiting a Closed outcome awaits the network task, so the socket and the buffers are gone when it returns. Dropping the last handle does the same shutdown, without waiting for it.

Handles may be given up at the same time, by close or by Drop, in any mix: the shutdown goes to whichever goes last, so at most one call reads Closed, and none does when the last handle is a dropped one.

§Example
use rustis::{client::{Client, CloseOutcome}, Result};

let client = Client::connect("127.0.0.1:6379").await?;
let clone = client.clone();

assert_eq!(CloseOutcome::StillShared, client.close().await?);
assert_eq!(CloseOutcome::Closed, clone.close().await?);
Source

pub fn into_exclusive(self) -> Result<ExclusiveClient>

Turns this handle into an ExclusiveClient, the client that owns its connection and may therefore run BlockingCommands and watch.

The conversion succeeds only when this is the sole handle on the connection. A surviving clone would keep sending commands over a connection the exclusive client believes is its own, which is the very situation the two client types exist to prevent — so the check is what gives ExclusiveClient its meaning, not a formality. Streams already opened from this client (create_pub_sub, a Transaction, a MonitorStream) hold a handle too and count here.

The client is consumed either way: on failure other handles exist by definition, so nothing is lost with it. Two clones converting concurrently both observe the other and both fail, which is the safe direction.

§Errors

ClientError::NotExclusive when another handle on the same connection is alive.

§Example
use rustis::{client::Client, commands::BlockingCommands, Result};

let client = Client::connect("127.0.0.1:6379").await?.into_exclusive()?;
let result: Option<(String, String)> = client.blpop("key", 30.).await?;
Source

pub fn on_reconnect(&self) -> Receiver<()>

Used to receive notifications when the client reconnects to the Redis server.

To turn this receiver into a Stream, you can use the BroadcastStream wrapper.

Source

pub async fn send<T: DeserializeOwned>( &self, command: impl Into<Command>, retry_on_error: Option<bool>, ) -> Result<T>

Send an arbitrary command to the server.

This is used primarily intended for implementing high level commands API but may also be used to provide access to new features that lack a direct API.

§Arguments
  • command - generic Command meant to be sent to the Redis server.
  • retry_on_error - retry to send the command on network error.
    • None - default behaviour defined in Config::retry_on_error
    • Some(true) - retry sending command on network error
    • Some(false) - do not retry sending command on network error
§Errors

Any Redis driver Error that occurs during the send operation

§Warning

In Cluster mode, the arguments that are Redis keys must be added with CommandBuilder::key: a command built with arg alone carries no slot and is sent to a random node. A multi-key command such as MSET also requires all its keys to hash to the same slot, which the {my} hash tag guarantees in the example below.

Unless R is an Option, a nil reply decodes as the neutral value of R (0, 0.0, false, "") instead of being rejected. Declare Option<R> when the command can reply nil. See Command results.

Dropping the returned future does not cancel the command: the message is already queued, so it is sent and executed by the server and only the reply is discarded. A timeout, a select! or an aborted task therefore leaves a non-idempotent command applied. See Cancellation and timeouts.

§Example
use rustis::{client::Client, commands::{FlushingMode, ServerCommands}, resp::cmd, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let client = Client::connect("127.0.0.1:6379").await?;

    client.flushall(FlushingMode::Sync).await?;

    client
        .send::<()>(
            cmd("MSET")
                .key("{my}key1")
                .arg("value1")
                .key("{my}key2")
                .arg("value2")
                .key("{my}key3")
                .arg("value3")
                .key("{my}key4")
                .arg("value4"),
            None,
        )
        .await?;

    let values: Vec<String> = client
        .send(
            cmd("MGET")
                .key("{my}key1")
                .key("{my}key2")
                .key("{my}key3")
                .key("{my}key4"),
            None,
        )
        .await?;

    assert_eq!(vec!["value1".to_owned(), "value2".to_owned(), "value3".to_owned(), "value4".to_owned()], values);

    Ok(())
}
Source

pub async fn send_raw( &self, command: impl Into<Command>, retry_on_error: Option<bool>, ) -> Result<RawResponse>

Sends an arbitrary command to the server and hands back the reply as RESP bytes.

This is the reply below the serde layer, for the callers that do not want a Rust type out of it: a proxy forwarding replies to another connection, a bridge to another protocol, a reader of a shape no type models. Anything that reads a value is better served by send, and Value is the same reply as a tree.

A Redis error is a reply here, not a failure: it is handed back like any other, since a caller forwarding replies has to forward the failures too. RawResponse::is_error tells them apart, and an installed CommandInterceptor is told the command failed, as it is on send. The returned Error is therefore the driver’s own: a connection lost, a timeout, a reply that cannot be read.

§Arguments
  • command - generic Command meant to be sent to the Redis server.
  • retry_on_error - retry to send the command on network error.
    • None - default behaviour defined in Config::retry_on_error
    • Some(true) - retry sending command on network error
    • Some(false) - do not retry sending command on network error
§Errors

Any Redis driver Error that occurs during the send operation

§Warning

The bytes are the frame the client received, byte for byte, except for a reply the client built itself: see what is verbatim and what is rewritten.

The Cluster key rule of send applies here too.

§Example
use rustis::{client::Client, commands::StringCommands, resp::cmd, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let client = Client::connect("127.0.0.1:6379").await?;
    client.set("raw_key", "value").await?;

    let raw = client.send_raw(cmd("GET").key("raw_key"), None).await?;
    assert_eq!(b"$5\r\nvalue\r\n", raw.as_bytes());

    Ok(())
}
Source

pub fn send_and_forget( &self, command: impl Into<Command>, retry_on_error: Option<bool>, ) -> Result<()>

Send command to the Redis server and forget its response.

§Arguments
  • command - generic Command meant to be sent to the Redis server.
  • retry_on_error - retry to send the command on network error.
    • None - default behaviour defined in Config::retry_on_error
    • Some(true) - retry sending command on network error
    • Some(false) - do not retry sending command on network error
§Errors

Any Redis driver Error that occurs during the send operation

Source

pub fn create_transaction(&self) -> Transaction

Create a new transaction

Source

pub fn create_pipeline<'a>(&'a self) -> Pipeline<'a>

Create a new pipeline

Source

pub fn create_pub_sub(&self) -> PubSubStream

Create a new pub sub stream with no upfront subscription

Source

pub fn create_client_tracking_invalidation_stream( &self, ) -> Result<ClientTrackingInvalidationStream>

Create a stream of client-side caching invalidations.

The stream yields the keys Redis has invalidated, as BulkString — Redis keys are binary-safe. Enable tracking on the same client with client_tracking for the server to start sending them.

use rustis::{client::{Client, ClientTrackingInvalidationStream}, Result};

async fn watch(client: &Client) -> Result<ClientTrackingInvalidationStream> {
    client.create_client_tracking_invalidation_stream()
}

Trait Implementations§

Source§

impl<'a> ArrayCommands<'a> for &'a Client

Source§

fn arcount(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Return the number of non-empty elements in the array. Read more
Source§

fn ardel( self, key: impl Serialize, indices: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Delete the elements at the given indices. Read more
Source§

fn ardelrange( self, key: impl Serialize, ranges: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Delete the elements in one or more inclusive (start, end) ranges. Read more
Source§

fn arget<R: DeserializeOwned>( self, key: impl Serialize, index: usize, ) -> PreparedCommand<'a, Self, R>

Get the value at an index. Read more
Source§

fn argetrange<R: DeserializeOwned>( self, key: impl Serialize, start: usize, end: usize, ) -> PreparedCommand<'a, Self, R>

Get the values in the inclusive index range [start, end]. Read more
Source§

fn argrep<R: DeserializeOwned>( self, key: impl Serialize, start: impl Serialize, end: impl Serialize, options: ArGrep<'_>, ) -> PreparedCommand<'a, Self, R>

Search the elements of a range with textual predicates. Read more
Source§

fn arinfo( self, key: impl Serialize, options: ArInfoOptions, ) -> PreparedCommand<'a, Self, ArrayInfo>

Return metadata about the array. Read more
Source§

fn arinsert( self, key: impl Serialize, values: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Insert one or more values at consecutive indices, starting at the array’s insert cursor. The cursor advances by one per value. Read more
Source§

fn arlastitems<R: DeserializeOwned>( self, key: impl Serialize, count: usize, options: ArLastItemsOptions, ) -> PreparedCommand<'a, Self, R>

Return the count most recently inserted elements. Read more
Source§

fn arlen(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Return the length of the array: the highest index in use, plus one. Read more
Source§

fn armget<R: DeserializeOwned>( self, key: impl Serialize, indices: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get the values at several indices. Read more
Source§

fn armset( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Set several (index, value) pairs at once. The pairs need not be contiguous nor ordered. Read more
Source§

fn arnext(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Return the index arinsert would write next. Read more
Source§

fn arop<R: DeserializeOwned>( self, key: impl Serialize, start: usize, end: usize, operation: ArOperation<'_>, ) -> PreparedCommand<'a, Self, R>

Aggregate the non-empty elements of the inclusive range [start, end]. Read more
Source§

fn arring( self, key: impl Serialize, size: usize, values: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Insert values into a ring buffer of size slots. Read more
Source§

fn arscan<R: DeserializeOwned>( self, key: impl Serialize, start: usize, end: usize, limit: impl Into<Option<usize>>, ) -> PreparedCommand<'a, Self, R>

Iterate the non-empty elements of the inclusive range [start, end]. Read more
Source§

fn arseek( self, key: impl Serialize, index: usize, ) -> PreparedCommand<'a, Self, bool>

Move the insert cursor used by arinsert and arring. Read more
Source§

fn arset( self, key: impl Serialize, index: usize, values: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Set one or more values at consecutive indices, starting at index. Read more
Source§

impl<'a> BitmapCommands<'a> for &'a Client

Source§

fn bitcount( self, key: impl Serialize, range: BitRange, ) -> PreparedCommand<'a, Self, usize>

Count the number of set bits (population counting) in a string. Read more
Source§

fn bitfield<'b>( self, key: impl Serialize, sub_commands: impl IntoIterator<Item = BitFieldSubCommand<'b>> + Serialize, ) -> PreparedCommand<'a, Self, Vec<u64>>

The command treats a Redis string as an array of bits, and is capable of addressing specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset. Read more
Source§

fn bitfield_readonly<'b>( self, key: impl Serialize, sub_commands: impl IntoIterator<Item = BitFieldSubCommand<'b>> + Serialize, ) -> PreparedCommand<'a, Self, Vec<u64>>

Read-only variant of the BITFIELD command. It is like the original BITFIELD but only accepts GET subcommand and can safely be used in read-only replicas. Read more
Source§

fn bitop( self, operation: BitOperation, dest_key: impl Serialize, keys: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. Read more
Source§

fn bitpos( self, key: impl Serialize, bit: u64, range: BitRange, ) -> PreparedCommand<'a, Self, usize>

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. Read more
Source§

fn getbit( self, key: impl Serialize, offset: u64, ) -> PreparedCommand<'a, Self, u64>

Returns the bit value at offset in the string value stored at key. Read more
Source§

fn setbit( self, key: impl Serialize, offset: u64, value: u64, ) -> PreparedCommand<'a, Self, u64>

Sets or clears the bit at offset in the string value stored at key. Read more
Source§

impl<'a> BloomCommands<'a> for &'a Client

Source§

fn bf_add( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Adds an item to a bloom filter Read more
Source§

fn bf_exists( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Determines whether an item may exist in the Bloom Filter or not. Read more
Source§

fn bf_card(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns the cardinality of a Bloom filter: the number of items successfully added to it. Read more
Source§

fn bf_info_all( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, BfInfoResult>

Return information about key filter. Read more
Source§

fn bf_info<R: DeserializeOwned>( self, key: impl Serialize, param: BfInfoParameter, ) -> PreparedCommand<'a, Self, R>

Return information about key filter for a specific information parameter Read more
Source§

fn bf_insert<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, options: BfInsertOptions, ) -> PreparedCommand<'a, Self, R>

bf_insert is a sugarcoated combination of bf_reserve and bf_add. Read more
Source§

fn bf_loadchunk( self, key: impl Serialize, iterator: i64, data: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Restores a filter previously saved using bf_scandump. Read more
Source§

fn bf_madd<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Adds one or more items to the Bloom Filter and creates the filter if it does not exist yet. Read more
Source§

fn bf_mexists<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Determines if one or more items may exist in the filter or not. Read more
Source§

fn bf_reserve( self, key: impl Serialize, error_rate: f64, capacity: usize, options: BfReserveOptions, ) -> PreparedCommand<'a, Self, ()>

Creates an empty Bloom Filter with a single sub-filter for the initial capacity requested and with an upper bound error_rate. Read more
Source§

fn bf_scandump( self, key: impl Serialize, iterator: i64, ) -> PreparedCommand<'a, Self, BfScanDumpResult>

Begins an incremental save of the bloom filter. This is useful for large bloom filters which cannot fit into the normal dump and restore model. Read more
Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

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<'a> ClusterCommands<'a> for &'a Client

Source§

fn cluster_addslots( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

This command is useful in order to modify a node’s view of the cluster configuration. Read more
Source§

fn cluster_addslotsrange( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

This command is similar to the cluster_addslots command in that they both assign hash slots to nodes. Read more
Source§

fn cluster_bumpepoch(self) -> PreparedCommand<'a, Self, ClusterBumpEpochResult>

Advances the cluster config epoch. Read more
Source§

fn cluster_count_failure_reports( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

The command returns the number of failure reports for the specified node. Read more
Source§

fn cluster_countkeysinslot( self, slot: usize, ) -> PreparedCommand<'a, Self, usize>

Returns the number of keys in the specified Redis Cluster hash slot. Read more
Source§

fn cluster_delslots( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

In Redis Cluster, each node keeps track of which master is serving a particular hash slot. This command asks a particular Redis Cluster node to forget which master is serving the hash slots specified as arguments. Read more
Source§

fn cluster_delslotsrange( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

This command is similar to the cluster_delslotsrange command in that they both remove hash slots from the node. Read more
Source§

fn cluster_failover( self, option: Option<ClusterFailoverOption>, ) -> PreparedCommand<'a, Self, ()>

This command, that can only be sent to a Redis Cluster replica node, forces the replica to start a manual failover of its master instance. Read more
Source§

fn cluster_flushslots(self) -> PreparedCommand<'a, Self, ()>

Deletes all slots from a node. Read more
Source§

fn cluster_forget( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

The command is used in order to remove a node, specified via its node ID, from the set of known nodes of the Redis Cluster node receiving the command. In other words the specified node is removed from the nodes table of the node receiving the command. Read more
Source§

fn cluster_getkeysinslot<R: DeserializeOwned>( self, slot: u16, count: usize, ) -> PreparedCommand<'a, Self, R>

The command returns an array of keys names stored in the contacted node and hashing to the specified hash slot. Read more
Source§

fn cluster_info(self) -> PreparedCommand<'a, Self, ClusterInfo>

This command provides info style information about Redis Cluster vital parameters. Read more
Source§

fn cluster_keyslot(self, key: impl Serialize) -> PreparedCommand<'a, Self, u16>

Returns an integer identifying the hash slot the specified key hashes to. Read more
Each node in a Redis Cluster maintains a pair of long-lived TCP link with each peer in the cluster: Read more
Source§

fn cluster_meet( self, ip: impl Serialize, port: u16, cluster_bus_port: Option<u16>, ) -> PreparedCommand<'a, Self, ()>

This command is used in order to connect different Redis nodes with cluster support enabled, into a working cluster. Read more
Source§

fn cluster_myid<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

This command returns the unique, auto-generated identifier that is associated with the connected cluster node. Read more
Source§

fn cluster_myshardid<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Returns the shard id of the node the client is connected to. Read more
Source§

fn cluster_nodes<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Each node in a Redis Cluster has its view of the current cluster configuration, given by the set of known nodes, the state of the connection we have with such nodes, their flags, properties and assigned slots, and so forth. Read more
Source§

fn cluster_replicas<R: DeserializeOwned>( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, R>

The command provides a list of replica nodes replicating from the specified master node. Read more
Source§

fn cluster_replicate( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

The command reconfigures a node as a replica of the specified master. If the node receiving the command is an empty master, as a side effect of the command, the node role is changed from master to replica. Read more
Source§

fn cluster_reset( self, reset_type: ClusterResetType, ) -> PreparedCommand<'a, Self, ()>

Reset a Redis Cluster node, in a more or less drastic way depending on the reset type, that can be hard or soft. Read more
Source§

fn cluster_saveconfig(self) -> PreparedCommand<'a, Self, ()>

Forces a node to save the nodes.conf configuration on disk. Before to return the command calls fsync(2) in order to make sure the configuration is flushed on the computer disk. Read more
Source§

fn cluster_set_config_epoch( self, config_epoch: u64, ) -> PreparedCommand<'a, Self, ()>

This command sets a specific config epoch in a fresh node. Read more
Source§

fn cluster_setslot( self, slot: u16, subcommand: ClusterSetSlotSubCommand<'_>, ) -> PreparedCommand<'a, Self, ()>

This command is responsible of changing the state of a hash slot in the receiving node in different ways. Read more
Source§

fn cluster_shards<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

This command returns details about the shards of the cluster. Read more
Source§

fn cluster_slot_stats<R: DeserializeOwned>( self, filter: ClusterSlotStatsFilter, ) -> PreparedCommand<'a, Self, R>

Returns per-slot usage statistics for the slots assigned to the current node. Read more
Source§

fn cluster_migration_import<R: DeserializeOwned>( self, slot_ranges: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Starts an atomic migration importing the given inclusive slot ranges onto the current (destination) master. Read more
Source§

fn cluster_migration_cancel( self, target: ClusterMigrationTarget<'_>, ) -> PreparedCommand<'a, Self, usize>

Cancels an ongoing atomic migration task by id, or all of them. Read more
Source§

fn cluster_migration_status<R: DeserializeOwned>( self, target: ClusterMigrationTarget<'_>, ) -> PreparedCommand<'a, Self, R>

Returns the status of atomic migration tasks: a single task for a ClusterMigrationTarget::Id, or all tasks for ClusterMigrationTarget::All. Read more
Source§

impl<'a> ConnectionCommands<'a> for &'a Client

Source§

fn auth( self, username: impl Serialize, password: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Authenticates the current connection. Read more
Source§

fn client_caching( self, mode: ClientCachingMode, ) -> PreparedCommand<'a, Self, Option<()>>

This command controls the tracking of the keys in the next command executed by the connection, when tracking is enabled in OPTIN or OPTOUT mode. Read more
Source§

fn client_getname<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Returns the name of the current connection as set by [CLIENT SETNAME]. Read more
Source§

fn client_getredir(self) -> PreparedCommand<'a, Self, i64>

This command returns the client ID we are redirecting our tracking notifications to. Read more
Source§

fn client_help<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

The command returns a helpful text describing the different CLIENT subcommands. Read more
Source§

fn client_id(self) -> PreparedCommand<'a, Self, i64>

The command just returns the ID of the current connection. Read more
Source§

fn client_info(self) -> PreparedCommand<'a, Self, ClientInfo>

The command returns information and statistics about the current client connection in a mostly human readable format. Read more
Source§

fn client_kill( self, options: ClientKillOptions<'_>, ) -> PreparedCommand<'a, Self, usize>

Closes a given clients connection based on a filter list Read more
Source§

fn client_list( self, options: ClientListOptions, ) -> PreparedCommand<'a, Self, ClientListResult>

Returns information and statistics about the client connections server in a mostly human readable format. Read more
Source§

fn client_no_evict(self, no_evict: bool) -> PreparedCommand<'a, Self, ()>

sets the client eviction mode for the current connection. Read more
Source§

fn client_no_touch(self, no_touch: bool) -> PreparedCommand<'a, Self, ()>

The command controls whether commands sent by the client will alter the LRU/LFU of the keys they access. If ON, the client will not change LFU/LRU stats. If OFF or send TOUCH, client will change LFU/LRU stats just as a normal client. Read more
Source§

fn client_pause( self, timeout: u64, mode: ClientPauseMode, ) -> PreparedCommand<'a, Self, ()>

Connections control command able to suspend all the Redis clients for the specified amount of time (in milliseconds). Read more
Source§

fn client_reply(self, mode: ClientReplyMode) -> PreparedCommand<'a, Self, ()>

Sometimes it can be useful for clients to completely disable replies from the Redis server. Read more
Source§

fn client_setname( self, connection_name: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Assigns a name to the current connection. Read more
Source§

fn client_setinfo( self, attr: ClientInfoAttribute, info: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Assigns various info attributes to the current connection. There is no limit to the length of these attributes. However it is not possible to use spaces, newlines, or other non-printable characters. Look changes with commands client_list or client_info. Read more
Source§

fn client_tracking( self, status: ClientTrackingStatus, options: ClientTrackingOptions, ) -> PreparedCommand<'a, Self, ()>

This command enables the tracking feature of the Redis server, that is used for server assisted client side caching. Read more
Source§

fn client_trackinginfo(self) -> PreparedCommand<'a, Self, ClientTrackingInfo>

This command enables the tracking feature of the Redis server, that is used for server assisted client side caching. Read more
Source§

fn client_unblock( self, client_id: i64, mode: ClientUnblockMode, ) -> PreparedCommand<'a, Self, bool>

This command can unblock, from a different connection, a client blocked in a blocking operation, such as for instance BRPOP or XREAD or WAIT. Read more
Source§

fn client_unpause(self) -> PreparedCommand<'a, Self, bool>

Used to resume command processing for all clients that were paused by client_pause. Read more
Source§

fn echo<R: DeserializeOwned>( self, message: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns message. Read more
Source§

fn ping<R: DeserializeOwned>( self, message: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk. Read more
Source§

fn reset(self) -> PreparedCommand<'a, Self, ()>

This command performs a full reset of the connection’s server-side context, mimicking the effect of disconnecting and reconnecting again. Read more
Source§

fn select(self, index: usize) -> PreparedCommand<'a, Self, ()>

Select the Redis logical database having the specified zero-based numeric index. Read more
Source§

impl<'a> CountMinSketchCommands<'a> for &'a Client

Source§

fn cms_incrby<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Increases the count of item by increment. Read more
Source§

fn cms_info( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, CmsInfoResult>

Returns width, depth and total count of the sketch. Read more
Source§

fn cms_initbydim( self, key: impl Serialize, width: usize, depth: usize, ) -> PreparedCommand<'a, Self, ()>

Initializes a Count-Min Sketch to dimensions specified by user. Read more
Source§

fn cms_initbyprob( self, key: impl Serialize, error: f64, probability: f64, ) -> PreparedCommand<'a, Self, ()>

Initializes a Count-Min Sketch to accommodate requested tolerances. Read more
Source§

fn cms_merge( self, destination: impl Serialize, sources: impl Serialize, weights: Option<impl Serialize>, ) -> PreparedCommand<'a, Self, ()>

Returns the count for one or more items in a sketch. Read more
Source§

fn cms_query<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Merges several sketches into one sketch. Read more
Source§

impl<'a> CuckooCommands<'a> for &'a Client

Source§

fn cf_add( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Adds an item to the cuckoo filter, creating the filter if it does not exist. Read more
Source§

fn cf_addnx( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Adds an item to a cuckoo filter if the item did not exist previously. Read more
Source§

fn cf_count( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Returns the number of times an item may be in the filter. Read more
Source§

fn cf_del( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Deletes an item once from the filter. Read more
Source§

fn cf_exists( self, key: impl Serialize, item: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Check if an item exists in a Cuckoo Filter key Read more
Source§

fn cf_info(self, key: impl Serialize) -> PreparedCommand<'a, Self, CfInfoResult>

Return information about key Read more
Source§

fn cf_insert( self, key: impl Serialize, options: CfInsertOptions, item: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<bool>>

Adds one or more items to a cuckoo filter, allowing the filter to be created with a custom capacity if it does not exist yet. Read more
Source§

fn cf_insertnx<R: DeserializeOwned>( self, key: impl Serialize, options: CfInsertOptions, item: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Adds one or more items to a cuckoo filter, allowing the filter to be created with a custom capacity if it does not exist yet. Read more
Source§

fn cf_loadchunk( self, key: impl Serialize, iterator: i64, data: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Restores a filter previously saved using cf_scandump. Read more
Source§

fn cf_mexists<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Check if one or more items exists in a Cuckoo Filter key Read more
Source§

fn cf_reserve( self, key: impl Serialize, capacity: usize, options: CfReserveOptions, ) -> PreparedCommand<'a, Self, ()>

Create a Cuckoo Filter as key with a single sub-filter for the initial amount of capacity for items. Because of how Cuckoo Filters work, the filter is likely to declare itself full before capacity is reached and therefore fill rate will likely never reach 100%. The fill rate can be improved by using a larger bucketsize at the cost of a higher error rate. When the filter self-declare itself full, it will auto-expand by generating additional sub-filters at the cost of reduced performance and increased error rate. The new sub-filter is created with size of the previous sub-filter multiplied by expansion. Like bucket size, additional sub-filters grow the error rate linearly. The size of the new sub-filter is the size of the last sub-filter multiplied by expansion. Read more
Source§

fn cf_scandump( self, key: impl Serialize, iterator: i64, ) -> PreparedCommand<'a, Self, CfScanDumpResult>

Begins an incremental save of the cuckoo filter. This is useful for large cuckoo filters which cannot fit into the normal dump and restore model. Read more
Source§

impl<'a> GenericCommands<'a> for &'a Client

Source§

fn copy( self, source: impl Serialize, destination: impl Serialize, destination_db: Option<usize>, replace: bool, ) -> PreparedCommand<'a, Self, bool>

This command copies the value stored at the source key to the destination key. Read more
Source§

fn del(self, keys: impl Serialize) -> PreparedCommand<'a, Self, usize>

Removes the specified keys. A key is ignored if it does not exist. Read more
Source§

fn dump(self, key: impl Serialize) -> PreparedCommand<'a, Self, BulkString>

Serialize the value stored at key in a Redis-specific format and return it to the user. Read more
Source§

fn exists(self, keys: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns if keys exist. Read more
Source§

fn expire( self, key: impl Serialize, seconds: u64, option: impl Into<Option<ExpireOption>>, ) -> PreparedCommand<'a, Self, bool>

Set a timeout on key in seconds Read more
Source§

fn expireat( self, key: impl Serialize, unix_time_seconds: u64, option: impl Into<Option<ExpireOption>>, ) -> PreparedCommand<'a, Self, bool>

EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970) Read more
Source§

fn expiretime(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire. Read more
Source§

fn keys<R: DeserializeOwned>( self, pattern: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns all keys matching pattern. Read more
Source§

fn migrate( self, host: impl Serialize, port: u16, key: impl Serialize, destination_db: usize, timeout: u64, options: MigrateOptions<'_>, ) -> PreparedCommand<'a, Self, MigrateResult>

Atomically transfer a key or a collection of keys from a source Redis instance to a destination Redis instance. Read more
Source§

fn move_(self, key: impl Serialize, db: usize) -> PreparedCommand<'a, Self, i64>

Move key from the currently selected database to the specified destination database. Read more
Source§

fn object_encoding<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the internal encoding for the Redis object stored at key Read more
Source§

fn object_freq(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

This command returns the logarithmic access frequency counter of a Redis object stored at key. Read more
Source§

fn object_help<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

The command returns a helpful text describing the different OBJECT subcommands. Read more
Source§

fn object_idle_time(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

This command returns the time in seconds since the last access to the value stored at key. Read more
Source§

fn object_refcount(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

This command returns the reference count of the stored at key. Read more
Source§

fn persist(self, key: impl Serialize) -> PreparedCommand<'a, Self, bool>

Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated). Read more
Source§

fn pexpire( self, key: impl Serialize, milliseconds: u64, option: impl Into<Option<ExpireOption>>, ) -> PreparedCommand<'a, Self, bool>

This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds. Read more
Source§

fn pexpireat( self, key: impl Serialize, unix_time_milliseconds: u64, option: impl Into<Option<ExpireOption>>, ) -> PreparedCommand<'a, Self, bool>

PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds. Read more
Source§

fn pexpiretime(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

PEXPIRETIME has the same semantic as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds. Read more
Source§

fn pttl(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

Returns the remaining time to live of a key that has a timeout. Read more
Source§

fn randomkey<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Return a random key from the currently selected database. Read more
Source§

fn rename( self, key: impl Serialize, new_key: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Renames key to newkey. Read more
Source§

fn renamenx( self, key: impl Serialize, new_key: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Renames key to newkey if newkey does not yet exist. It returns an error when key does not exist. Read more
Source§

fn restore( self, key: impl Serialize, ttl: u64, serialized_value: &BulkString, options: RestoreOptions, ) -> PreparedCommand<'a, Self, ()>

Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP). Read more
Source§

fn scan<R: DeserializeOwned>( self, cursor: u64, options: ScanOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Iterates the set of keys in the currently selected Redis database. Read more
Source§

fn sort<R: DeserializeOwned>( self, key: impl Serialize, options: SortOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Returns the elements contained in the list, set or sorted set at key. Read more
Source§

fn sort_and_store( self, key: impl Serialize, destination: impl Serialize, options: SortOptions<'_>, ) -> PreparedCommand<'a, Self, usize>

Stores the elements contained in the list, set or sorted set at key. Read more
Source§

fn sort_readonly<R: DeserializeOwned>( self, key: impl Serialize, options: SortOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Read-only variant of the SORT command. Read more
Source§

fn touch(self, keys: impl Serialize) -> PreparedCommand<'a, Self, usize>

Alters the last access time of a key(s). A key is ignored if it does not exist. Read more
Source§

fn ttl(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

Returns the remaining time to live of a key that has a timeout. Read more
Source§

fn type_<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the string representation of the type of the value stored at key. Read more
This command is very similar to DEL: it removes the specified keys. Read more
Source§

fn wait( self, num_replicas: usize, timeout: u64, ) -> PreparedCommand<'a, Self, usize>

This command blocks the current client until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas. Read more
Source§

fn waitaof( self, num_local: usize, num_replicas: usize, timeout: u64, ) -> PreparedCommand<'a, Self, (usize, usize)>

This command blocks the current client until all previous write commands by that client are acknowledged as having been fsynced to the AOF of the local Redis and/or at least the specified number of replicas. Read more
Source§

impl<'a> GeoCommands<'a> for &'a Client

Source§

fn geoadd( self, key: impl Serialize, condition: impl Into<Option<GeoAddCondition>>, change: bool, items: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Adds the specified geospatial items (longitude, latitude, name) to the specified key. Read more
Source§

fn geodist( self, key: impl Serialize, member1: impl Serialize, member2: impl Serialize, unit: GeoUnit, ) -> PreparedCommand<'a, Self, Option<f64>>

Return the distance between two members in the geospatial index represented by the sorted set. Read more
Source§

fn geohash<R: DeserializeOwned>( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return valid Geohash strings representing the position of one or more elements in a sorted set value representing a geospatial index (where elements were added using geoadd). Read more
Source§

fn geopos( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<Option<(f64, f64)>>>

Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key. Read more
Source§

fn geosearch<'b, R: DeserializeOwned>( self, key: impl Serialize, from: GeoSearchFrom<'b>, by: GeoSearchBy, options: GeoSearchOptions, ) -> PreparedCommand<'a, Self, R>

Return the members of a sorted set populated with geospatial information using geoadd, which are within the borders of the area specified by a given shape. Read more
Source§

fn geosearchstore<'b>( self, destination: impl Serialize, source: impl Serialize, from: GeoSearchFrom<'b>, by: GeoSearchBy, options: GeoSearchStoreOptions, ) -> PreparedCommand<'a, Self, u32>

This command is like geosearch, but stores the result in destination key. Read more
Source§

impl<'a> HashCommands<'a> for &'a Client

Source§

fn hdel( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Removes the specified fields from the hash stored at key. Read more
Source§

fn hexists( self, key: impl Serialize, field: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Returns if field is an existing field in the hash stored at key. Read more
Source§

fn hexpire<R: DeserializeOwned>( self, key: impl Serialize, seconds: u64, option: impl Into<Option<ExpireOption>>, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Set an expiration (TTL or time to live) on one or more fields of a given hash key. Read more
Source§

fn hexpireat<R: DeserializeOwned>( self, key: impl Serialize, unix_time_seconds: u64, option: impl Into<Option<ExpireOption>>, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

HEXPIREAT has the same effect and semantics as HEXPIRE, but instead of specifying the number of seconds for the TTL (time to live), it takes an absolute Unix timestamp in seconds since Unix epoch. Read more
Source§

fn hexpiretime<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the absolute Unix timestamp in seconds since Unix epoch at which the given key’s field(s) will expire. Read more
Source§

fn hget<R: DeserializeOwned>( self, key: impl Serialize, field: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the value associated with field in the hash stored at key. Read more
Source§

fn hgetall<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns all fields and values of the hash stored at key. Read more
Source§

fn hgetdel<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

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

fn hgetex<R: DeserializeOwned>( self, key: impl Serialize, options: GetExOptions, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get the value of one or more fields of a given hash key and optionally set their expiration time or time-to-live (TTL). Read more
Source§

fn hincrby( self, key: impl Serialize, field: impl Serialize, increment: i64, ) -> PreparedCommand<'a, Self, i64>

Increments the number stored at field in the hash stored at key by increment. Read more
Source§

fn hincrbyfloat( self, key: impl Serialize, field: impl Serialize, increment: f64, ) -> PreparedCommand<'a, Self, f64>

Increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment. Read more
Source§

fn hkeys<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns all field names in the hash stored at key. Read more
Source§

fn hlen(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns the number of fields contained in the hash stored at key. Read more
Source§

fn hmget<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the values associated with the specified fields in the hash stored at key. Read more
Source§

fn hpersist<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Remove the existing expiration on a hash key’s field(s), turning the field(s) from volatile (a field with expiration set) to persistent (a field that will never expire as no TTL (time to live) is associated). Read more
Source§

fn hpexpire<R: DeserializeOwned>( self, key: impl Serialize, milliseconds: u64, option: impl Into<Option<ExpireOption>>, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command works like hexpire, but the expiration of a field is specified in milliseconds instead of seconds. Read more
Source§

fn hpexpireat<R: DeserializeOwned>( self, key: impl Serialize, unix_time_milliseconds: u64, option: impl Into<Option<ExpireOption>>, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command has the same effect and semantics as hexpireat, but the Unix time at which the field will expire is specified in milliseconds since Unix epoch instead of seconds. Read more
Source§

fn hpexpiretime<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command has the same semantics as hexpiretime, but returns the absolute Unix expiration timestamp in milliseconds since Unix epoch instead of seconds. Read more
Source§

fn hpttl<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Like httl, this command returns the remaining TTL (time to live) of a field that has an expiration set, but in milliseconds instead of seconds. Read more
Source§

fn hrandfield<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

return random fields from the hash value stored at key. Read more
Source§

fn hrandfields<R: DeserializeOwned>( self, key: impl Serialize, count: isize, ) -> PreparedCommand<'a, Self, R>

return random fields from the hash value stored at key. Read more
Source§

fn hrandfields_with_values<R: DeserializeOwned>( self, key: impl Serialize, count: isize, ) -> PreparedCommand<'a, Self, R>

return random fields from the hash value stored at key. Read more
Source§

fn hscan<F: DeserializeOwned, V: DeserializeOwned>( self, key: impl Serialize, cursor: u64, options: HScanOptions<'_>, ) -> PreparedCommand<'a, Self, HScanResult<F, V>>

Iterates fields of Hash types and their associated values. Read more
Source§

fn hscan_no_values<R: DeserializeOwned>( self, key: impl Serialize, cursor: u64, options: HScanOptions<'_>, ) -> PreparedCommand<'a, Self, (u64, R)>

Iterates fields of Hash types, without their associated values. Read more
Source§

fn hset( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Sets field in the hash stored at key to value. Read more
Source§

fn hsetex( self, key: impl Serialize, condition: impl Into<Option<HSetExCondition>>, expiration: impl Into<Option<SetExpiration>>, items: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Set the value of one or more fields of a given hash key, and optionally set their expiration time or time-to-live (TTL). Read more
Source§

fn hsetnx( self, key: impl Serialize, field: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Sets field in the hash stored at key to value, only if field does not yet exist. Read more
Source§

fn hstrlen( self, key: impl Serialize, field: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Returns the string length of the value associated with field in the hash stored at key. Read more
Source§

fn httl<R: DeserializeOwned>( self, key: impl Serialize, fields: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the remaining TTL (time to live) of a hash key’s field(s) that have a set expiration. This introspection capability allows you to check how many seconds a given hash field will continue to be part of the hash key. Read more
Source§

fn hvals<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

list of values in the hash, or an empty list when key does not exist. Read more
Source§

impl<'a> HyperLogLogCommands<'a> for &'a Client

Source§

fn pfadd( self, key: impl Serialize, elements: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Adds the specified elements to the specified HyperLogLog. Read more
Source§

fn pfcount(self, keys: impl Serialize) -> PreparedCommand<'a, Self, usize>

Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). Read more
Source§

fn pfmerge( self, dest_key: impl Serialize, source_keys: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Merge N different HyperLogLogs into a single one. Read more
Source§

impl<'a> JsonCommands<'a> for &'a Client

Source§

fn json_arrappend<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, values: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Append the json values into the array at path after the last element in it Read more
Source§

fn json_arrindex<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, value: impl Serialize, options: JsonArrIndexOptions, ) -> PreparedCommand<'a, Self, R>

Search for the first occurrence of a scalar JSON value in an array Read more
Source§

fn json_arrinsert<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, index: isize, values: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Insert the json values into the array at path before the index (shifts to the right) Read more
Source§

fn json_arrlen<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Report the length of the JSON array at path in key Read more
Source§

fn json_arrpop<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, index: isize, ) -> PreparedCommand<'a, Self, R>

Remove and return an element from the index in the array Read more
Source§

fn json_arrtrim<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, start: isize, stop: isize, ) -> PreparedCommand<'a, Self, R>

Remove and return an element from the index in the array Read more
Source§

fn json_clear( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Clear container values (arrays/objects) and set numeric values to 0 Read more
Source§

fn json_debug_memory<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Report a value’s memory usage in bytes Read more
Source§

fn json_del( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Delete a value Read more
Source§

fn json_forget( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Source§

fn json_get<R: DeserializeOwned>( self, key: impl Serialize, options: JsonGetOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Return the value at path in JSON serialized form Read more
Source§

fn json_mget<R: DeserializeOwned>( self, keys: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return the values at path from multiple key arguments Read more
Source§

fn json_merge( self, key: impl Serialize, path: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Merge a given JSON value into matching paths. Read more
Source§

fn json_mset( self, key_path_values: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Set or update one or more JSON values according to the specified key-path-value triplets Read more
Source§

fn json_numincrby<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Increment the number value stored at path by number Read more
Source§

fn json_nummultby<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Multiply the number value stored at path by number Read more
Source§

fn json_objkeys<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return the keys in the object that’s referenced by path Read more
Source§

fn json_objlen<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Report the number of keys in the JSON object at path in key Read more
Source§

fn json_resp<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Source§

fn json_set<'b>( self, key: impl Serialize, path: impl Serialize, value: impl Serialize, options: impl Into<Option<JsonSetOptions<'b>>>, ) -> PreparedCommand<'a, Self, ()>

Set the JSON value at path in key Read more
Source§

fn json_strappend<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Append the json-string values to the string at path Read more
Source§

fn json_strlen<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Report the length of the JSON String at path in key Read more
Source§

fn json_toggle<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Toggle a Boolean value stored at path Read more
Source§

fn json_type<R: DeserializeOwned>( self, key: impl Serialize, path: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Report the type of JSON value at path Read more
Source§

impl<'a> ListCommands<'a> for &'a Client

Source§

fn lindex<R: DeserializeOwned>( self, key: impl Serialize, index: isize, ) -> PreparedCommand<'a, Self, R>

Returns the element at index index in the list stored at key. Read more
Source§

fn linsert( self, key: impl Serialize, where_: LInsertWhere, pivot: impl Serialize, element: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Inserts element in the list stored at key either before or after the reference value pivot. Read more
Source§

fn llen(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Inserts element in the list stored at key either before or after the reference value pivot. Read more
Source§

fn lmove<R: DeserializeOwned>( self, source: impl Serialize, destination: impl Serialize, where_from: LMoveWhere, where_to: LMoveWhere, ) -> PreparedCommand<'a, Self, R>

Atomically returns and removes the first/last element (head/tail depending on the wherefrom argument) of the list stored at source, and pushes the element at the first/last element (head/tail depending on the whereto argument) of the list stored at destination. Read more
Source§

fn lmpop<R: DeserializeOwned>( self, keys: impl Serialize, where_: LMoveWhere, count: usize, ) -> PreparedCommand<'a, Self, (String, Vec<R>)>

Pops one or more elements from the first non-empty list key from the list of provided key names. Read more
Source§

fn lpop<R: DeserializeOwned>( self, key: impl Serialize, count: u32, ) -> PreparedCommand<'a, Self, R>

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

fn lpos( self, key: impl Serialize, element: impl Serialize, rank: Option<usize>, max_len: Option<usize>, ) -> PreparedCommand<'a, Self, Option<usize>>

Returns the index of matching elements inside a Redis list. Read more
Source§

fn lpos_with_count<R: DeserializeOwned>( self, key: impl Serialize, element: impl Serialize, num_matches: usize, rank: Option<usize>, max_len: Option<usize>, ) -> PreparedCommand<'a, Self, R>

Returns the index of matching elements inside a Redis list. Read more
Source§

fn lpush( self, key: impl Serialize, elements: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Insert all the specified values at the head of the list stored at key Read more
Source§

fn lpushx( self, key: impl Serialize, elements: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Inserts specified values at the head of the list stored at key, only if key already exists and holds a list. Read more
Source§

fn lrange<R: DeserializeOwned>( self, key: impl Serialize, start: isize, stop: isize, ) -> PreparedCommand<'a, Self, R>

Returns the specified elements of the list stored at key. Read more
Source§

fn lrem( self, key: impl Serialize, count: isize, element: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Removes the first count occurrences of elements equal to element from the list stored at key. Read more
Source§

fn lset( self, key: impl Serialize, index: isize, element: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Sets the list element at index to element. Read more
Source§

fn ltrim( self, key: impl Serialize, start: isize, stop: isize, ) -> PreparedCommand<'a, Self, ()>

Trim an existing list so that it will contain only the specified range of elements specified. Read more
Source§

fn rpop<R: DeserializeOwned>( self, key: impl Serialize, count: u32, ) -> PreparedCommand<'a, Self, R>

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

fn rpush( self, key: impl Serialize, elements: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Insert all the specified values at the tail of the list stored at key Read more
Source§

fn rpushx( self, key: impl Serialize, elements: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list. Read more
Source§

impl<'a> PubSubCommands<'a> for &'a Client

Source§

async fn subscribe(self, channels: impl Serialize) -> Result<PubSubStream>

Subscribes the client to the specified channels. Read more
Source§

async fn psubscribe(self, patterns: impl Serialize) -> Result<PubSubStream>

Subscribes the client to the given patterns. Read more
Source§

async fn ssubscribe(self, shardchannels: impl Serialize) -> Result<PubSubStream>

Subscribes the client to the specified channels. Read more
Source§

fn publish( self, channel: impl Serialize, message: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Posts a message to the given channel. Read more
Source§

fn pub_sub_channels<R: DeserializeOwned>( self, pattern: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Lists the currently active channels. Read more
Source§

fn pub_sub_help(self) -> PreparedCommand<'a, Self, Vec<String>>

The command returns a helpful text describing the different PUBSUB subcommands. Read more
Source§

fn pub_sub_numpat(self) -> PreparedCommand<'a, Self, usize>

Returns the number of unique patterns that are subscribed to by clients (that are performed using the PSUBSCRIBE command). Read more
Source§

fn pub_sub_numsub<R: DeserializeOwned>( self, channels: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels. Read more
Source§

fn pub_sub_shardchannels<R: DeserializeOwned>( self, pattern: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Lists the currently active shard channels. Read more
Source§

fn pub_sub_shardnumsub<R: DeserializeOwned>( self, channels: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the number of subscribers for the specified shard channels. Read more
Source§

fn spublish( self, shardchannel: impl Serialize, message: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Posts a message to the given shard channel. Read more
Source§

impl<'a> ScriptingCommands<'a> for &'a Client

Source§

fn eval<R: DeserializeOwned>( self, script: impl Serialize, keys: impl Serialize, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Invoke the execution of a server-side Lua script. Read more
Source§

fn eval_readonly<R: DeserializeOwned>( self, script: impl Serialize, keys: impl Serialize, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This is a read-only variant of the eval] command that cannot execute commands that modify data. Read more
Source§

fn evalsha<R: DeserializeOwned>( self, sha1: impl Serialize, keys: impl Serialize, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Evaluate a script from the server’s cache by its SHA1 digest. Read more
Source§

fn evalsha_readonly<R: DeserializeOwned>( self, sha1: impl Serialize, keys: impl Serialize, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This is a read-only variant of the evalsha command that cannot execute commands that modify data. Read more
Source§

fn fcall<R: DeserializeOwned>( self, function: impl Serialize, keys: impl Serialize, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Invoke a function. Read more
Source§

fn fcall_readonly<R: DeserializeOwned>( self, function: impl Serialize, keys: impl Serialize, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Invoke a function. Read more
Source§

fn function_delete( self, library_name: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Delete a library and all its functions. Read more
Source§

fn function_dump(self) -> PreparedCommand<'a, Self, BulkString>

Return the serialized payload of loaded libraries. You can restore the serialized payload later with the function_restore command. Read more
Source§

fn function_flush( self, flushing_mode: FlushingMode, ) -> PreparedCommand<'a, Self, ()>

Deletes all the libraries. Read more
Source§

fn function_help(self) -> PreparedCommand<'a, Self, Vec<String>>

The command returns a helpful text describing the different FUNCTION subcommands. Read more
Source§

fn function_kill(self) -> PreparedCommand<'a, Self, ()>

Kill a function that is currently executing. Read more
Source§

fn function_list( self, options: FunctionListOptions<'_>, ) -> PreparedCommand<'a, Self, Vec<LibraryInfo>>

Return information about the functions and libraries. Read more
Source§

fn function_load<R: DeserializeOwned>( self, replace: bool, function_code: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Load a library to Redis. Read more
Source§

fn function_restore( self, serialized_payload: &BulkString, policy: impl Into<Option<FunctionRestorePolicy>>, ) -> PreparedCommand<'a, Self, ()>

Restore libraries from the serialized payload. Read more
Source§

fn function_stats(self) -> PreparedCommand<'a, Self, FunctionStats>

Return information about the function that’s currently running and information about the available execution engines. Read more
Source§

fn script_debug( self, debug_mode: ScriptDebugMode, ) -> PreparedCommand<'a, Self, ()>

Set the debug mode for subsequent scripts executed with EVAL. Read more
Source§

fn script_exists( self, sha1s: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<bool>>

Returns information about the existence of the scripts in the script cache. Read more
Source§

fn script_flush( self, flushing_mode: FlushingMode, ) -> PreparedCommand<'a, Self, ()>

Flush the Lua scripts cache. Read more
Source§

fn script_kill(self) -> PreparedCommand<'a, Self, ()>

Kills the currently executing EVAL script, assuming no write operation was yet performed by the script. Read more
Source§

fn script_load<R: DeserializeOwned>( self, script: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Load a script into the scripts cache, without executing it. Read more
Source§

impl<'a> SearchCommands<'a> for &'a Client

Source§

fn ft_aggregate( self, index: impl Serialize, query: impl Serialize, options: FtAggregateOptions<'_>, ) -> PreparedCommand<'a, Self, FtAggregateResult>

Run a search query on an index, and perform aggregate transformations on the results, extracting statistics etc from them Read more
Source§

fn ft_aliasadd( self, alias: impl Serialize, index: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Add an alias to an index Read more
Source§

fn ft_aliasdel(self, alias: impl Serialize) -> PreparedCommand<'a, Self, ()>

Remove an alias from an index Read more
Source§

fn ft_aliasupdate( self, alias: impl Serialize, index: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Add an alias to an index. Read more
Source§

fn ft_alter( self, index: impl Serialize, skip_initial_scan: bool, attribute: FtFieldSchema<'_>, ) -> PreparedCommand<'a, Self, ()>

Add a new attribute to the index. Read more
Source§

fn ft_config_get<R: DeserializeOwned>( self, option: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Retrieve configuration options Read more
Source§

fn ft_config_set( self, option: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Set configuration options Read more
Source§

fn ft_create( self, index: impl Serialize, options: FtCreateOptions<'_>, ) -> PreparedCommand<'a, Self, ()>

Create an index with the given specification Read more
Source§

fn ft_cursor_del( self, index: impl Serialize, cursor_id: u64, ) -> PreparedCommand<'a, Self, ()>

Delete a cursor Read more
Source§

fn ft_cursor_read( self, index: impl Serialize, cursor_id: u64, ) -> PreparedCommand<'a, Self, FtAggregateResult>

Read next results from an existing cursor Read more
Source§

fn ft_dictadd( self, dict: impl Serialize, terms: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Add terms to a dictionary Read more
Source§

fn ft_dictdel( self, dict: impl Serialize, terms: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Delete terms from a dictionary Read more
Source§

fn ft_dictdump<R: DeserializeOwned>( self, dict: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Dump all terms in the given dictionary Read more
Source§

fn ft_dropindex( self, index: impl Serialize, dd: bool, ) -> PreparedCommand<'a, Self, ()>

Delete an index Read more
Source§

fn ft_explain<R: DeserializeOwned>( self, index: impl Serialize, query: impl Serialize, dialect_version: Option<u64>, ) -> PreparedCommand<'a, Self, R>

Return the execution plan for a complex query Read more
Source§

fn ft_explaincli( self, index: impl Serialize, query: impl Serialize, dialect_version: Option<u64>, ) -> PreparedCommand<'a, Self, Value>

Return the execution plan for a complex query but formatted for easier reading without using redis-cli --raw Read more
Source§

fn ft_info( self, index: impl Serialize, ) -> PreparedCommand<'a, Self, FtInfoResult>

Return information and statistics on the index Read more
Source§

fn ft_list<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Returns a list of all existing indexes. Read more
Source§

fn ft_hybrid<R: DeserializeOwned>( self, index: impl Serialize, search: FtHybridSearch<'_>, vsim: FtHybridVsim<'_>, options: FtHybridOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Performs a hybrid search combining a text search (FtHybridSearch) and a vector similarity search (FtHybridVsim), fusing their results. Read more
Perform a ft_search command and collects performance information Read more
Source§

fn ft_profile_aggregate( self, index: impl Serialize, limited: bool, query: impl Serialize, ) -> PreparedCommand<'a, Self, Value>

Perform a ft_aggregate command and collects performance information Read more
Search the index with a textual query, returning either documents or just ids Read more
Source§

fn ft_spellcheck( self, index: impl Serialize, query: impl Serialize, options: FtSpellCheckOptions<'_>, ) -> PreparedCommand<'a, Self, FtSpellCheckResult>

Perform spelling correction on a query, returning suggestions for misspelled terms Read more
Source§

fn ft_syndump<R: DeserializeOwned>( self, index: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Dump the contents of a synonym group Read more
Source§

fn ft_synupdate( self, index: impl Serialize, synonym_group_id: impl Serialize, skip_initial_scan: bool, terms: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Update a synonym group Read more
Source§

fn ft_tagvals<R: DeserializeOwned>( self, index: impl Serialize, field_name: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return a distinct set of values indexed in a Tag field Read more
Source§

fn ft_sugadd( self, key: impl Serialize, string: impl Serialize, score: f64, options: FtSugAddOptions<'_>, ) -> PreparedCommand<'a, Self, usize>

Add a suggestion string to an auto-complete suggestion dictionary Read more
Source§

fn ft_sugdel( self, key: impl Serialize, string: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Delete a string from a suggestion index Read more
Source§

fn ft_sugget<R: DeserializeOwned>( self, key: impl Serialize, prefix: impl Serialize, options: FtSugGetOptions, ) -> PreparedCommand<'a, Self, R>

Get completion suggestions for a prefix Read more
Source§

fn ft_suglen(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Get the size of an auto-complete suggestion dictionary Read more
Source§

impl<'a> SentinelCommands<'a> for &'a Client

Source§

fn sentinel_config_get<R: DeserializeOwned>( self, name: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get the current value of a global Sentinel configuration parameter. Read more
Source§

fn sentinel_config_set( self, name: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Set the value of a global Sentinel configuration parameter.
Source§

fn sentinel_ckquorum<R: DeserializeOwned>( self, master_name: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover. Read more
Source§

fn sentinel_failover( self, master_name: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Force a failover as if the master was not reachable, and without asking for agreement to other Sentinels (however a new version of the configuration will be published so that the other Sentinels will update their configurations).
Source§

fn sentinel_flushconfig(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Force Sentinel to rewrite its configuration on disk, including the current Sentinel state. Read more
Source§

fn sentinel_get_master_addr_by_name( self, master_name: impl Serialize, ) -> PreparedCommand<'a, Self, Option<(String, u16)>>

Return the ip and port number of the master with that name. Read more
Source§

fn sentinel_info_cache<R: DeserializeOwned>( self, master_names: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return cached info output from masters and replicas.
Source§

fn sentinel_master( self, master_name: impl Serialize, ) -> PreparedCommand<'a, Self, SentinelMasterInfo>

Show the state and info of the specified master.
Source§

fn sentinel_masters(self) -> PreparedCommand<'a, Self, Vec<SentinelMasterInfo>>
where Self: Sized,

Show a list of monitored masters and their state.
Source§

fn sentinel_monitor( self, name: impl Serialize, ip: impl Serialize, port: u16, quorum: usize, ) -> PreparedCommand<'a, Self, ()>

This command tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum. Read more
Source§

fn sentinel_remove(self, name: impl Serialize) -> PreparedCommand<'a, Self, ()>

This command is used in order to remove the specified master. Read more
Source§

fn sentinel_set( self, name: impl Serialize, configs: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

The SET command is very similar to the config_set command of Redis, and is used in order to change configuration parameters of a specific master. Read more
Source§

fn sentinel_myid(self) -> PreparedCommand<'a, Self, String>

Return the ID of the Sentinel instance.
Source§

fn sentinel_pending_scripts(self) -> PreparedCommand<'a, Self, Vec<Value>>

This command returns information about pending scripts.
Source§

fn sentinel_replicas( self, master_name: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<SentinelReplicaInfo>>

Show a list of replicas for this master, and their state.
Source§

fn sentinel_reset( self, pattern: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

This command will reset all the masters with matching name. Read more
Source§

fn sentinel_sentinels( self, master_name: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<SentinelInfo>>

Show a list of sentinel instances for this master, and their state.
Source§

fn sentinel_simulate_failure( self, mode: SentinelSimulateFailureMode, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command simulates different Sentinel crash scenarios.
Source§

impl<'a> ServerCommands<'a> for &'a Client

Source§

fn acl_cat<R: DeserializeOwned>( self, options: AclCatOptions<'_>, ) -> PreparedCommand<'a, Self, R>

The command shows the available ACL categories if called without arguments. If a category name is given, the command shows all the Redis commands in the specified category. Read more
Source§

fn acl_deluser( self, usernames: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Delete all the specified ACL users and terminate all the connections that are authenticated with such users. Read more
Source§

fn acl_dryrun<R: DeserializeOwned>( self, username: impl Serialize, command: impl Serialize, options: AclDryRunOptions, ) -> PreparedCommand<'a, Self, R>

Simulate the execution of a given command by a given user. Read more
Source§

fn acl_genpass<R: DeserializeOwned>( self, options: AclGenPassOptions, ) -> PreparedCommand<'a, Self, R>

Generates a password starting from /dev/urandom if available, otherwise (in systems without /dev/urandom) it uses a weaker system that is likely still better than picking a weak password by hand. Read more
Source§

fn acl_getuser<R: DeserializeOwned>( self, username: impl Serialize, ) -> PreparedCommand<'a, Self, R>

The command returns all the rules defined for an existing ACL user. Read more
Source§

fn acl_help<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,

The command returns a helpful text describing the different ACL subcommands. Read more
Source§

fn acl_list<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,

The command shows the currently active ACL rules in the Redis server. Read more
Source§

fn acl_load(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

fn acl_log<R: DeserializeOwned>( self, options: AclLogOptions, ) -> PreparedCommand<'a, Self, R>

The command shows a list of recent ACL security events Read more
Source§

fn acl_save(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

fn acl_setuser( self, username: impl Serialize, rules: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Create an ACL user with the specified rules or modify the rules of an existing user. Read more
Source§

fn acl_users<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

The command shows a list of all the usernames of the currently configured users in the Redis ACL system. Read more
Source§

fn acl_whoami<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Return the username the current connection is authenticated with. Read more
Source§

fn bgrewriteaof<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

The command async rewrites the append-only file to disk. Read more
Source§

fn bgsave<R: DeserializeOwned>( self, options: BgsaveOptions, ) -> PreparedCommand<'a, Self, R>

The command save the DB in background. Read more
Source§

fn command(self) -> PreparedCommand<'a, Self, Vec<CommandInfo>>
where Self: Sized,

Return an array with details about every Redis command. Read more
Source§

fn command_count(self) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

Number of total commands in this Redis server. Read more
Source§

fn command_docs<R: DeserializeOwned>( self, command_names: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Number of total commands in this Redis server. Read more
Source§

fn command_getkeys<R: DeserializeOwned>( self, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

A helper command to let you find the keys from a full Redis command. Read more
Source§

fn command_getkeysandflags<R: DeserializeOwned>( self, args: impl Serialize, ) -> PreparedCommand<'a, Self, R>

A helper command to let you find the keys from a full Redis command together with flags indicating what each key is used for. Read more
Source§

fn command_help<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,

The command returns a helpful text describing the different COMMAND subcommands. Read more
Source§

fn command_info( self, command_names: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<CommandInfo>>

Return an array with details about multiple Redis command. Read more
Source§

fn command_list<R: DeserializeOwned>( self, options: CommandListOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Return an array of the server’s command names based on optional filters Read more
Source§

fn config_get<R: DeserializeOwned>( self, params: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Used to read the configuration parameters of a running Redis server. Read more
Source§

fn config_help(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command returns a helpful text describing the different CONFIG subcommands. Read more
Source§

fn config_resetstat(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Resets the statistics reported by Redis using the info command. Read more
Source§

fn config_rewrite(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Rewrites the redis.conf file the server was started with, applying the minimal changes needed to make it reflect the configuration currently used by the server, which may be different compared to the original one because of the use of the config_set command. Read more
Source§

fn config_set(self, configs: impl Serialize) -> PreparedCommand<'a, Self, ()>

Used in order to reconfigure the server at run time without the need to restart Redis. Read more
Source§

fn dbsize(self) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

Return the number of keys in the currently-selected database. Read more
Source§

fn failover(self, options: FailOverOptions<'_>) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command will start a coordinated failover between the currently-connected-to master and one of its replicas. Read more
Source§

fn flushdb( self, flushing_mode: impl Into<Option<FlushingMode>>, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Delete all the keys of the currently selected DB. Read more
Source§

fn flushall( self, flushing_mode: impl Into<Option<FlushingMode>>, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Delete all the keys of all the existing databases, not just the currently selected one. Read more
Source§

fn info<R: DeserializeOwned>( self, sections: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans. Read more
Source§

fn hotkeys_start( self, metrics: impl Serialize, options: HotKeysStartOptions, ) -> PreparedCommand<'a, Self, ()>

Starts a hotkeys tracking session on the server. Read more
Source§

fn hotkeys_stop(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Stops the current hotkeys tracking session, keeping its results available to hotkeys_get. Read more
Source§

fn hotkeys_get<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Returns the results of the hotkeys tracking session, one entry per node. Read more
Source§

fn hotkeys_reset(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Releases the memory used by the hotkeys tracking session, discarding its results. The session must have been stopped first. Read more
Source§

fn hotkeys_help<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

The HOTKEYS HELP command returns a helpful text describing the different subcommands. Read more
Source§

fn lastsave(self) -> PreparedCommand<'a, Self, u64>
where Self: Sized,

Return the UNIX TIME of the last DB save executed with success. Read more
Source§

fn latency_doctor<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,

This command reports about different latency-related issues and advises about possible remedies. Read more
Source§

fn latency_graph<R: DeserializeOwned>( self, event: LatencyHistoryEvent, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Produces an ASCII-art style graph for the specified event. Read more
Source§

fn latency_help<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,

The command returns a helpful text describing the different LATENCY subcommands. Read more
Source§

fn latency_histogram<R: DeserializeOwned>( self, commands: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command reports a cumulative distribution of latencies in the format of a histogram for each of the specified command names. Read more
Source§

fn latency_history<R: DeserializeOwned>( self, event: LatencyHistoryEvent, ) -> PreparedCommand<'a, Self, R>

This command returns the raw data of the event’s latency spikes time series. Read more
Source§

fn latency_latest<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

This command reports the latest latency events logged. Read more
Source§

fn latency_reset( self, events: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

This command resets the latency spikes time series of all, or only some, events. Read more
Source§

fn lolwut(self, options: LolWutOptions) -> PreparedCommand<'a, Self, String>
where Self: Sized,

The LOLWUT command displays the Redis version: however as a side effect of doing so, it also creates a piece of generative computer art that is different with each version of Redis. Read more
Source§

fn memory_doctor(self) -> PreparedCommand<'a, Self, String>
where Self: Sized,

This command reports about different memory-related issues that the Redis server experiences, and advises about possible remedies. Read more
Source§

fn memory_help(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command returns a helpful text describing the different MEMORY subcommands. Read more
Source§

fn memory_malloc_stats(self) -> PreparedCommand<'a, Self, String>
where Self: Sized,

This command provides an internal statistics report from the memory allocator. Read more
Source§

fn memory_purge(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command attempts to purge dirty pages so these can be reclaimed by the allocator. Read more
Source§

fn memory_stats(self) -> PreparedCommand<'a, Self, MemoryStats>
where Self: Sized,

This command returns information about the memory usage of the server. Read more
Source§

fn memory_usage( self, key: impl Serialize, options: MemoryUsageOptions, ) -> PreparedCommand<'a, Self, Option<usize>>

This command reports the number of bytes that a key and its value require to be stored in RAM. Read more
Source§

fn module_list<R: DeserializeOwned>(self) -> PreparedCommand<'a, Self, R>

Returns information about the modules loaded to the server. Read more
Source§

fn module_loadex( self, path: impl Serialize, options: ModuleLoadexOptions, ) -> PreparedCommand<'a, Self, ()>

Loads a module from a dynamic library at runtime, setting its configuration parameters before it initializes. Read more
Source§

fn module_unload(self, name: impl Serialize) -> PreparedCommand<'a, Self, ()>

Unloads a module by the name it registered itself under — which is the name reported by module_list, not its file path. Read more
Source§

fn module_help(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command returns a helpful text describing the different MODULE subcommands. Read more
Source§

fn replicaof( self, options: ReplicaOfOptions<'_>, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command can change the replication settings of a replica on the fly. Read more
Source§

fn role(self) -> PreparedCommand<'a, Self, RoleResult>
where Self: Sized,

Provide information on the role of a Redis instance in the context of replication, by returning if the instance is currently a master, slave, or sentinel. Read more
Source§

fn save(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command performs a synchronous save of the dataset producing a point in time snapshot of all the data inside the Redis instance, in the form of an RDB file. Read more
Source§

fn shutdown(self, options: ShutdownOptions) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Shutdown the server Read more
Source§

fn slowlog_get( self, options: SlowLogGetOptions, ) -> PreparedCommand<'a, Self, Vec<SlowLogEntry>>
where Self: Sized,

This command returns entries from the slow log in chronological order. Read more
Source§

fn slowlog_help(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command returns a helpful text describing the different SLOWLOG subcommands. Read more
Source§

fn slowlog_len(self) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

This command returns the current number of entries in the slow log. Read more
Source§

fn slowlog_reset(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command resets the slow log, clearing all entries in it. Read more
Source§

fn swapdb(self, index1: usize, index2: usize) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command swaps two Redis databases, so that immediately all the clients connected to a given database will see the data of the other database, and the other way around. Read more
Source§

fn time(self) -> PreparedCommand<'a, Self, (u32, u32)>
where Self: Sized,

The TIME command returns the current server time as a two items lists: a Unix timestamp and the amount of microseconds already elapsed in the current second. Read more
Source§

impl<'a> SetCommands<'a> for &'a Client

Source§

fn sadd( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Add the specified members to the set stored at key. Read more
Source§

fn scard(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns the set cardinality (number of elements) of the set stored at key. Read more
Source§

fn sdiff<R: DeserializeOwned>( self, keys: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the members of the set resulting from the difference between the first set and all the successive sets. Read more
Source§

fn sdiffstore( self, destination: impl Serialize, keys: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

This command is equal to sdiff, but instead of returning the resulting set, it is stored in destination. Read more
Source§

fn sinter<R: DeserializeOwned>( self, keys: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the members of the set resulting from the intersection of all the given sets. Read more
Source§

fn sintercard( self, keys: impl Serialize, limit: usize, ) -> PreparedCommand<'a, Self, usize>

This command is similar to sinter, but instead of returning the result set, it returns just the cardinality of the result. Read more
Source§

fn sinterstore( self, destination: impl Serialize, keys: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

This command is equal to sinter, but instead of returning the resulting set, it is stored in destination. Read more
Source§

fn sismember( self, key: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Returns if member is a member of the set stored at key. Read more
Source§

fn smembers<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns all the members of the set value stored at key. Read more
Source§

fn smismember<R: DeserializeOwned>( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns whether each member is a member of the set stored at key. Read more
Source§

fn smove( self, source: impl Serialize, destination: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Move member from the set at source to the set at destination. Read more
Source§

fn spop<R: DeserializeOwned>( self, key: impl Serialize, count: usize, ) -> PreparedCommand<'a, Self, R>

Removes and returns one or more random members from the set value store at key. Read more
Source§

fn srandmember<R: DeserializeOwned>( self, key: impl Serialize, count: usize, ) -> PreparedCommand<'a, Self, R>

Removes and returns one or more random members from the set value store at key. Read more
Source§

fn srem( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Remove the specified members from the set stored at key. Read more
Source§

fn sscan<R: DeserializeOwned>( self, key: impl Serialize, cursor: u64, options: SScanOptions<'_>, ) -> PreparedCommand<'a, Self, (u64, R)>

Iterates elements of Sets types. Read more
Source§

fn sunion<R: DeserializeOwned>( self, keys: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the members of the set resulting from the union of all the given sets. Read more
Source§

fn sunionstore( self, destination: impl Serialize, keys: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

This command is equal to sunion, but instead of returning the resulting set, it is stored in destination. Read more
Source§

impl<'a> SortedSetCommands<'a> for &'a Client

Source§

fn zadd( self, key: impl Serialize, items: impl Serialize, options: ZAddOptions, ) -> PreparedCommand<'a, Self, usize>

Adds all the specified members with the specified scores to the sorted set stored at key. Read more
Source§

fn zadd_incr( self, key: impl Serialize, condition: impl Into<Option<ZAddCondition>>, comparison: impl Into<Option<ZAddComparison>>, change: bool, score: f64, member: impl Serialize, ) -> PreparedCommand<'a, Self, Option<f64>>

In this mode ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode. Read more
Source§

fn zcard(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns the sorted set cardinality (number of elements) of the sorted set stored at key. Read more
Source§

fn zcount( self, key: impl Serialize, min: impl Serialize, max: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Returns the number of elements in the sorted set at key with a score between min and max. Read more
Source§

fn zdiff<R: DeserializeOwned>( self, keys: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zdiff_with_scores<R: DeserializeOwned>( self, keys: impl Serialize, ) -> PreparedCommand<'a, Self, R>

This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zdiffstore( self, destination: impl Serialize, keys: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Computes the difference between the first and all successive input sorted sets and stores the result in destination. Read more
Source§

fn zincrby( self, key: impl Serialize, increment: f64, member: impl Serialize, ) -> PreparedCommand<'a, Self, f64>

Increments the score of member in the sorted set stored at key by increment. Read more
Source§

fn zinter<R: DeserializeOwned>( self, keys: impl Serialize, weights: impl Serialize, aggregate: impl Into<Option<ZAggregate>>, ) -> PreparedCommand<'a, Self, R>

This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zinter_with_scores<R: DeserializeOwned>( self, keys: impl Serialize, weights: impl Serialize, aggregate: impl Into<Option<ZAggregate>>, ) -> PreparedCommand<'a, Self, R>

This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zintercard( self, keys: impl Serialize, limit: usize, ) -> PreparedCommand<'a, Self, usize>

This command is similar to zinter, but instead of returning the result set, it returns just the cardinality of the result. Read more
Source§

fn zinterstore( self, destination: impl Serialize, keys: impl Serialize, weights: impl Serialize, aggregate: impl Into<Option<ZAggregate>>, ) -> PreparedCommand<'a, Self, usize>

Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination. Read more
Source§

fn zlexcount( self, key: impl Serialize, min: impl Serialize, max: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max. Read more
Source§

fn zmpop<R: DeserializeOwned>( self, keys: impl Serialize, where_: ZWhere, count: usize, ) -> PreparedCommand<'a, Self, Option<ZMPopResult<R>>>

Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names. Read more
Source§

fn zmscore<R: DeserializeOwned>( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the scores associated with the specified members in the sorted set stored at key. Read more
Source§

fn zpopmax<R: DeserializeOwned>( self, key: impl Serialize, count: usize, ) -> PreparedCommand<'a, Self, R>

Removes and returns up to count members with the highest scores in the sorted set stored at key. Read more
Source§

fn zpopmin<R: DeserializeOwned>( self, key: impl Serialize, count: usize, ) -> PreparedCommand<'a, Self, R>

Removes and returns up to count members with the lowest scores in the sorted set stored at key. Read more
Source§

fn zrandmember<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return a random element from the sorted set value stored at key. Read more
Source§

fn zrandmembers<R: DeserializeOwned>( self, key: impl Serialize, count: isize, ) -> PreparedCommand<'a, Self, R>

Return random elements from the sorted set value stored at key. Read more
Source§

fn zrandmembers_with_scores<R: DeserializeOwned>( self, key: impl Serialize, count: isize, ) -> PreparedCommand<'a, Self, R>

Return random elements with their scores from the sorted set value stored at key. Read more
Source§

fn zrange<R: DeserializeOwned>( self, key: impl Serialize, start: impl Serialize, stop: impl Serialize, options: ZRangeOptions, ) -> PreparedCommand<'a, Self, R>

Returns the specified range of elements in the sorted set stored at key. Read more
Source§

fn zrange_with_scores<R: DeserializeOwned>( self, key: impl Serialize, start: impl Serialize, stop: impl Serialize, options: ZRangeOptions, ) -> PreparedCommand<'a, Self, R>

Returns the specified range of elements in the sorted set stored at key. Read more
Source§

fn zrangestore( self, dst: impl Serialize, src: impl Serialize, start: impl Serialize, stop: impl Serialize, options: ZRangeOptions, ) -> PreparedCommand<'a, Self, usize>

This command is like zrange, but stores the result in the dst destination key. Read more
Source§

fn zrank( self, key: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, Option<usize>>

Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. Read more
Source§

fn zrank_with_score( self, key: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, Option<(usize, f64)>>

Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. Read more
Source§

fn zrem( self, key: impl Serialize, members: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Removes the specified members from the sorted set stored at key. Read more
Source§

fn zremrangebylex( self, key: impl Serialize, start: impl Serialize, stop: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max. Read more
Source§

fn zremrangebyrank( self, key: impl Serialize, start: isize, stop: isize, ) -> PreparedCommand<'a, Self, usize>

Removes all elements in the sorted set stored at key with rank between start and stop. Read more
Source§

fn zremrangebyscore( self, key: impl Serialize, start: impl Serialize, stop: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Removes all elements in the sorted set stored at key with a score between min and max (inclusive). Read more
Source§

fn zrevrank( self, key: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, Option<usize>>

Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. Read more
Source§

fn zrevrank_with_score( self, key: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, Option<(usize, f64)>>

Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. Read more
Source§

fn zscan<R: DeserializeOwned>( self, key: impl Serialize, cursor: usize, options: ZScanOptions<'_>, ) -> PreparedCommand<'a, Self, ZScanResult<R>>

Iterates elements of Sorted Set types and their associated scores. Read more
Source§

fn zscore( self, key: impl Serialize, member: impl Serialize, ) -> PreparedCommand<'a, Self, Option<f64>>

Returns the score of member in the sorted set at key. Read more
Source§

fn zunion<R: DeserializeOwned>( self, keys: impl Serialize, weights: impl Serialize, aggregate: impl Into<Option<ZAggregate>>, ) -> PreparedCommand<'a, Self, R>

This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zunion_with_scores<R: DeserializeOwned>( self, keys: impl Serialize, weights: impl Serialize, aggregate: impl Into<Option<ZAggregate>>, ) -> PreparedCommand<'a, Self, R>

This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zunionstore( self, destination: impl Serialize, keys: impl Serialize, weights: impl Serialize, aggregate: impl Into<Option<ZAggregate>>, ) -> PreparedCommand<'a, Self, usize>

Computes the unionsection of numkeys sorted sets given by the specified keys, and stores the result in destination. Read more
Source§

impl<'a> StreamCommands<'a> for &'a Client

Source§

fn xack( self, key: impl Serialize, group: impl Serialize, ids: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

The XACK command removes one or multiple messages from the Pending Entries List (PEL) of a stream consumer group Read more
Source§

fn xnack( self, key: impl Serialize, group: impl Serialize, mode: XNackMode, ids: impl Serialize, options: XNackOptions, ) -> PreparedCommand<'a, Self, usize>

Release pending messages back to the group’s PEL without acknowledging them, so another consumer can pick them up immediately. Read more
Source§

fn xadd<R: DeserializeOwned>( self, key: impl Serialize, stream_id: impl Serialize, items: impl Serialize, options: XAddOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Appends the specified stream entry to the stream at the specified key. Read more
Source§

fn xsetid( self, key: impl Serialize, last_id: impl Serialize, options: XSetIdOptions, ) -> PreparedCommand<'a, Self, ()>

Sets the last delivered id of a stream, and optionally the two counters that go with it. Read more
Source§

fn xcfgset( self, key: impl Serialize, options: XCfgSetOptions, ) -> PreparedCommand<'a, Self, ()>

Sets the idempotent message processing (IDMP) parameters of a stream. Read more
Source§

fn xautoclaim<R: DeserializeOwned>( self, key: impl Serialize, group: impl Serialize, consumer: impl Serialize, min_idle_time: u64, start: impl Serialize, options: XAutoClaimOptions, ) -> PreparedCommand<'a, Self, XAutoClaimResult<R>>

This command transfers ownership of pending stream entries that match the specified criteria. Read more
Source§

fn xclaim<R: DeserializeOwned>( self, key: impl Serialize, group: impl Serialize, consumer: impl Serialize, min_idle_time: u64, ids: impl Serialize, options: XClaimOptions, ) -> PreparedCommand<'a, Self, R>

In the context of a stream consumer group, this command changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument. Read more
Source§

fn xdel( self, key: impl Serialize, ids: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Removes the specified entries from a stream, and returns the number of entries deleted. Read more
Source§

fn xdelex( self, key: impl Serialize, policy: impl Into<Option<StreamEntryDeletionPolicy>>, ids: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<i64>>

Removes the specified entries from a stream, controlling what happens to the consumer-group references of the removed entries (Redis 8.2). Read more
Source§

fn xackdel( self, key: impl Serialize, group: impl Serialize, policy: impl Into<Option<StreamEntryDeletionPolicy>>, ids: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<i64>>

Acknowledges and deletes one or multiple messages for a stream consumer group in a single round trip (Redis 8.2). Read more
Source§

fn xgroup_create( self, key: impl Serialize, groupname: impl Serialize, id: impl Serialize, options: XGroupCreateOptions, ) -> PreparedCommand<'a, Self, bool>

This command creates a new consumer group uniquely identified by groupname for the stream stored at key. Read more
Source§

fn xgroup_createconsumer( self, key: impl Serialize, groupname: impl Serialize, consumername: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Create a consumer named consumername in the consumer group groupname`` of the stream that's stored at key. Read more
Source§

fn xgroup_delconsumer( self, key: impl Serialize, groupname: impl Serialize, consumername: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

The XGROUP DELCONSUMER command deletes a consumer from the consumer group. Read more
Source§

fn xgroup_destroy( self, key: impl Serialize, groupname: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

The XGROUP DESTROY command completely destroys a consumer group. Read more
Source§

fn xgroup_help(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command returns a helpful text describing the different XGROUP subcommands. Read more
Source§

fn xgroup_setid( self, key: impl Serialize, groupname: impl Serialize, id: impl Serialize, entries_read: Option<usize>, ) -> PreparedCommand<'a, Self, ()>

Set the last delivered ID for a consumer group. Read more
Source§

fn xinfo_consumers( self, key: impl Serialize, groupname: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<XConsumerInfo>>

This command returns the list of consumers that belong to the groupname consumer group of the stream stored at key. Read more
Source§

fn xinfo_groups( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, Vec<XGroupInfo>>

This command returns the list of consumers that belong to the groupname consumer group of the stream stored at key. Read more
Source§

fn xinfo_help(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command returns a helpful text describing the different XINFO subcommands. Read more
Source§

fn xinfo_stream( self, key: impl Serialize, options: XInfoStreamOptions, ) -> PreparedCommand<'a, Self, XStreamInfo>

This command returns information about the stream stored at key. Read more
Source§

fn xlen(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns the number of entries inside a stream. Read more
Source§

fn xpending( self, key: impl Serialize, group: impl Serialize, ) -> PreparedCommand<'a, Self, XPendingResult>

The XPENDING command is the interface to inspect the list of pending messages. Read more
Source§

fn xpending_with_options<R: DeserializeOwned>( self, key: impl Serialize, group: impl Serialize, options: XPendingOptions<'_>, ) -> PreparedCommand<'a, Self, R>

The XPENDING command is the interface to inspect the list of pending messages. Read more
Source§

fn xrange<R: DeserializeOwned>( self, key: impl Serialize, start: impl Serialize, end: impl Serialize, count: Option<usize>, ) -> PreparedCommand<'a, Self, R>

The command returns the stream entries matching a given range of IDs. Read more
Source§

fn xread<R: DeserializeOwned>( self, options: XReadOptions, keys: impl Serialize, ids: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller. Read more
Source§

fn xreadgroup<R: DeserializeOwned>( self, group: impl Serialize, consumer: impl Serialize, options: XReadGroupOptions, keys: impl Serialize, ids: impl Serialize, ) -> PreparedCommand<'a, Self, R>

The XREADGROUP command is a special version of the xread command with support for consumer groups. Read more
Source§

fn xrevrange<R: DeserializeOwned>( self, key: impl Serialize, end: impl Serialize, start: impl Serialize, count: Option<usize>, ) -> PreparedCommand<'a, Self, R>

This command is exactly like xrange, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order Read more
Source§

fn xtrim( self, key: impl Serialize, options: XTrimOptions<'_>, ) -> PreparedCommand<'a, Self, usize>

XTRIM trims the stream by evicting older entries (entries with lower IDs) if needed. Read more
Source§

impl<'a> StringCommands<'a> for &'a Client

Source§

fn append( self, key: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case. Read more
Source§

fn decr(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

Decrements the number stored at key by one. Read more
Source§

fn decrby( self, key: impl Serialize, decrement: i64, ) -> PreparedCommand<'a, Self, i64>

Decrements the number stored at key by one. Read more
Source§

fn get<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get the value of key. Read more
Source§

fn getdel<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get the value of key and delete the key. Read more
Source§

fn digest<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the hash digest of a string value as a hexadecimal string. Read more
Source§

fn delex<'b>( self, key: impl Serialize, condition: impl Into<Option<DelexCondition<'b>>>, ) -> PreparedCommand<'a, Self, i64>

Conditionally removes key based on a value or digest comparison. Read more
Source§

fn getex<R: DeserializeOwned>( self, key: impl Serialize, options: GetExOptions, ) -> PreparedCommand<'a, Self, R>

Get the value of key and optionally set its expiration. GETEX is similar to GET, but is a write command with additional options. Read more
Source§

fn getrange<R: DeserializeOwned>( self, key: impl Serialize, start: isize, end: isize, ) -> PreparedCommand<'a, Self, R>

Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive). Read more
Source§

fn incr(self, key: impl Serialize) -> PreparedCommand<'a, Self, i64>

Increments the number stored at key by one. Read more
Source§

fn incrby( self, key: impl Serialize, increment: i64, ) -> PreparedCommand<'a, Self, i64>

Increments the number stored at key by increment. Read more
Source§

fn increx<R: DeserializeOwned>( self, key: impl Serialize, options: IncrExOptions, ) -> PreparedCommand<'a, Self, R>

Increment the value at key, bounded, and set its expiration, atomically. Read more
Source§

fn incrbyfloat( self, key: impl Serialize, increment: f64, ) -> PreparedCommand<'a, Self, f64>

Increment the string representing a floating point number stored at key by the specified increment. By using a negative increment value, the result is that the value stored at the key is decremented (by the obvious properties of addition). If the key does not exist, it is set to 0 before performing the operation. An error is returned if one of the following conditions occur: Read more
Source§

fn lcs<R: DeserializeOwned>( self, key1: impl Serialize, key2: impl Serialize, ) -> PreparedCommand<'a, Self, R>

The LCS command implements the longest common subsequence algorithm Read more
Source§

fn lcs_len( self, key1: impl Serialize, key2: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

The LCS command implements the longest common subsequence algorithm Read more
Source§

fn lcs_idx( self, key1: impl Serialize, key2: impl Serialize, min_match_len: Option<usize>, with_match_len: bool, ) -> PreparedCommand<'a, Self, LcsResult>

The LCS command implements the longest common subsequence algorithm Read more
Source§

fn mget<R: DeserializeOwned>( self, keys: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the values of all specified keys. Read more
Source§

fn mset(self, items: impl Serialize) -> PreparedCommand<'a, Self, ()>

Sets the given keys to their respective values. Read more
Source§

fn msetex<'b>( self, items: impl Serialize, condition: impl Into<Option<SetCondition<'b>>>, expiration: impl Into<Option<SetExpiration>>, ) -> PreparedCommand<'a, Self, bool>

Atomically sets multiple string keys with an optional shared expiration in a single operation. Read more
Source§

fn msetnx(self, items: impl Serialize) -> PreparedCommand<'a, Self, bool>

Sets the given keys to their respective values. MSETNX will not perform any operation at all even if just a single key already exists. Read more
Source§

fn set( self, key: impl Serialize, value: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Set key to hold the string value. Read more
Source§

fn set_with_options<'b>( self, key: impl Serialize, value: impl Serialize, condition: impl Into<Option<SetCondition<'b>>>, expiration: impl Into<Option<SetExpiration>>, ) -> PreparedCommand<'a, Self, bool>

Set key to hold the string value. Read more
Source§

fn set_get_with_options<'b, R: DeserializeOwned>( self, key: impl Serialize, value: impl Serialize, condition: impl Into<Option<SetCondition<'b>>>, expiration: impl Into<Option<SetExpiration>>, ) -> PreparedCommand<'a, Self, R>

Set key to hold the string value wit GET option enforced Read more
Source§

fn setrange( self, key: impl Serialize, offset: usize, value: impl Serialize, ) -> PreparedCommand<'a, Self, usize>

Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. Read more
Source§

fn strlen(self, key: impl Serialize) -> PreparedCommand<'a, Self, usize>

Returns the length of the string value stored at key. Read more
Source§

impl<'a> TDigestCommands<'a> for &'a Client

Source§

fn tdigest_add( self, key: impl Serialize, values: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Adds one or more observations to a t-digest sketch. Read more
Source§

fn tdigest_byrank<R: DeserializeOwned>( self, key: impl Serialize, ranks: impl Serialize, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns, for each input rank, an estimation of the value (floating-point) with that rank. Read more
Source§

fn tdigest_byrevrank<R: DeserializeOwned>( self, key: impl Serialize, ranks: impl Serialize, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns, for each input reverse rank, an estimation of the value (floating-point) with that reverse rank. Read more
Source§

fn tdigest_cdf<R: DeserializeOwned>( self, key: impl Serialize, values: impl Serialize, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns, for each input reverse rank, an estimation of the value (floating-point) with that reverse rank. Read more
Source§

fn tdigest_create( self, key: impl Serialize, compression: Option<i64>, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Allocates memory and initializes a new t-digest sketch. Read more
Source§

fn tdigest_info( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, TDigestInfoResult>
where Self: Sized,

Returns information and statistics about a t-digest sketch Read more
Source§

fn tdigest_max(self, key: impl Serialize) -> PreparedCommand<'a, Self, f64>
where Self: Sized,

Returns the maximum observation value from a t-digest sketch. Read more
Source§

fn tdigest_merge( self, destination: impl Serialize, sources: impl Serialize, options: TDigestMergeOptions, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Merges multiple t-digest sketches into a single sketch. Read more
Source§

fn tdigest_min(self, key: impl Serialize) -> PreparedCommand<'a, Self, f64>
where Self: Sized,

Returns the minimum observation value from a t-digest sketch. Read more
Source§

fn tdigest_quantile<R: DeserializeOwned>( self, key: impl Serialize, quantiles: impl Serialize, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns, for each input fraction, an estimation of the value (floating point) that is smaller than the given fraction of observations. Read more
Source§

fn tdigest_rank<R: DeserializeOwned>( self, key: impl Serialize, values: impl Serialize, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns, for each input value (floating-point), the estimated rank of the value (the number of observations in the sketch that are smaller than the value + half the number of observations that are equal to the value). Read more
Source§

fn tdigest_reset(self, key: impl Serialize) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Resets a t-digest sketch: empty the sketch and re-initializes it. Read more
Source§

fn tdigest_revrank<R: DeserializeOwned>( self, key: impl Serialize, values: impl Serialize, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns, for each input value (floating-point), the estimated reverse rank of the value (the number of observations in the sketch that are smaller than the value + half the number of observations that are equal to the value). Read more
Source§

fn tdigest_trimmed_mean( self, key: impl Serialize, low_cut_quantile: f64, high_cut_quantile: f64, ) -> PreparedCommand<'a, Self, f64>
where Self: Sized,

Returns an estimation of the mean value from the sketch, excluding observation values outside the low and high cutoff quantiles. Read more
Source§

impl<'a> TimeSeriesCommands<'a> for &'a Client

Source§

fn ts_add( self, key: impl Serialize, timestamp: TsTimestamp, value: f64, options: TsAddOptions<'_>, ) -> PreparedCommand<'a, Self, u64>

Append a sample to a time series Read more
Source§

fn ts_alter( self, key: impl Serialize, options: TsCreateOptions<'_>, ) -> PreparedCommand<'a, Self, ()>

Update the retention, chunk size, duplicate policy, and labels of an existing time series Read more
Source§

fn ts_create( self, key: impl Serialize, options: TsCreateOptions<'_>, ) -> PreparedCommand<'a, Self, ()>

Create a new time series Read more
Source§

fn ts_createrule( self, src_key: impl Serialize, dst_key: impl Serialize, aggregator: TsAggregationType, bucket_duration: u64, options: TsCreateRuleOptions, ) -> PreparedCommand<'a, Self, ()>

Create a compaction rule Read more
Source§

fn ts_decrby( self, key: impl Serialize, value: f64, options: TsIncrByDecrByOptions<'_>, ) -> PreparedCommand<'a, Self, u64>

Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement Read more
Source§

fn ts_del( self, key: impl Serialize, from_timestamp: u64, to_timestamp: u64, ) -> PreparedCommand<'a, Self, usize>

Delete all samples between two timestamps for a given time series Read more
Source§

fn ts_deleterule( self, src_key: impl Serialize, dst_key: impl Serialize, ) -> PreparedCommand<'a, Self, ()>

Delete a compaction rule Read more
Source§

fn ts_get( self, key: impl Serialize, options: TsGetOptions, ) -> PreparedCommand<'a, Self, TsGetResult>

Get the last sample Read more
Source§

fn ts_incrby( self, key: impl Serialize, value: f64, options: TsIncrByDecrByOptions<'_>, ) -> PreparedCommand<'a, Self, u64>

Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment Read more
Source§

fn ts_info( self, key: impl Serialize, debug: bool, ) -> PreparedCommand<'a, Self, TsInfoResult>

Return information and statistics for a time series. Read more
Source§

fn ts_madd<R: DeserializeOwned>( self, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Append new samples to one or more time series Read more
Source§

fn ts_mget<R: DeserializeOwned>( self, options: TsMGetOptions<'_>, filters: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get the last samples matching a specific filter Read more
Source§

fn ts_mrange<R: DeserializeOwned>( self, from_timestamp: impl Serialize, to_timestamp: impl Serialize, options: TsMRangeOptions<'_>, filters: impl Serialize, groupby_options: TsGroupByOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Query a range across multiple time series by filters in forward direction Read more
Source§

fn ts_mrevrange<R: DeserializeOwned>( self, from_timestamp: impl Serialize, to_timestamp: impl Serialize, options: TsMRangeOptions<'_>, filters: impl Serialize, groupby_options: TsGroupByOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Query a range across multiple time series by filters in reverse direction Read more
Source§

fn ts_queryindex<R: DeserializeOwned>( self, filters: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Get all time series keys matching a filter list Read more
Source§

fn ts_range<R: DeserializeOwned>( self, key: impl Serialize, from_timestamp: impl Serialize, to_timestamp: impl Serialize, options: TsRangeOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Query a range in forward direction Read more
Source§

fn ts_revrange<R: DeserializeOwned>( self, key: impl Serialize, from_timestamp: impl Serialize, to_timestamp: impl Serialize, options: TsRangeOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Query a range in reverse direction Read more
Source§

impl<'a> TopKCommands<'a> for &'a Client

Source§

fn topk_add<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Adds an item to the data structure. Read more
Source§

fn topk_incrby<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Increase the score of an item in the data structure by increment. Read more
Source§

fn topk_info( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, TopKInfoResult>

Returns number of required items (k), width, depth and decay values. Read more
Source§

fn topk_list<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return full list of items in Top K list. Read more
Source§

fn topk_list_with_count<R: DeserializeOwned>( self, key: impl Serialize, ) -> PreparedCommand<'a, Self, TopKListWithCountResult<R>>

Return full list of items in Top K list. Read more
Source§

fn topk_query<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return full list of items in Top K list. Read more
Source§

fn topk_count<R: DeserializeOwned>( self, key: impl Serialize, items: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Returns the count for one or more items in a sketch. Read more
Source§

fn topk_reserve( self, key: impl Serialize, topk: usize, width_depth_decay: Option<(usize, usize, f64)>, ) -> PreparedCommand<'a, Self, ()>

Initializes a TopK with specified parameters. Read more
Source§

impl<'a> VectorSetCommands<'a> for &'a Client

Source§

fn vadd( self, key: impl Serialize, reduce_dim: impl Into<Option<u32>>, values: &[f32], element: impl Serialize, options: VAddOptions<'_>, ) -> PreparedCommand<'a, Self, bool>

Add a new element into the vector set specified by key. Read more
Source§

fn vcard(self, key: impl Serialize) -> PreparedCommand<'a, Self, u32>

Return the number of elements in the specified vector set. Read more
Source§

fn vdim(self, key: impl Serialize) -> PreparedCommand<'a, Self, u32>

Return the number of dimensions of the vectors in the specified vector set. Read more
Source§

fn vemb<R: DeserializeOwned>( self, key: impl Serialize, element: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return the approximate vector associated with a given element in the vector set. Read more
Source§

fn vgetattr<R: DeserializeOwned>( self, key: impl Serialize, element: impl Serialize, ) -> PreparedCommand<'a, Self, R>

Return the JSON attributes associated with an element in a vector set. Read more
Source§

fn vinfo(self, key: impl Serialize) -> PreparedCommand<'a, Self, VInfoResult>

Return metadata and internal details about a vector set, including size, dimensions, quantization type, and graph structure. Read more
Return the neighbors of a specified element in a vector set. The command shows the connections for each layer of the HNSW graph. Read more
Return the neighbors of a specified element in a vector set. The command shows the connections for each layer of the HNSW graph. Read more
Source§

fn vismember( self, key: impl Serialize, element: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Check if an element exists in a vector set. Read more
Source§

fn vrange<R: DeserializeOwned>( self, key: impl Serialize, start: impl Serialize, end: impl Serialize, count: impl Into<Option<usize>>, ) -> PreparedCommand<'a, Self, R>

Return vector set elements whose names fall in a lexicographic range. Read more
Source§

fn vrandmember<R: DeserializeOwned>( self, key: impl Serialize, count: isize, ) -> PreparedCommand<'a, Self, R>

Return one or more random elements from a vector set. Read more
Source§

fn vrem( self, key: impl Serialize, element: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Remove an element from a vector set. Read more
Source§

fn vsetattr( self, key: impl Serialize, element: impl Serialize, json: impl Serialize, ) -> PreparedCommand<'a, Self, bool>

Associate a JSON object with an element in a vector set. Read more
Source§

fn vsim<R: DeserializeOwned>( self, key: impl Serialize, vector_or_element: VectorOrElement<'_>, options: VSimOptions<'_>, ) -> PreparedCommand<'a, Self, R>

Return elements similar to a given vector or element. Use this command to perform approximate or exact similarity searches within a vector set. Read more

Auto Trait Implementations§

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> 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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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