Struct rustis::client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Client with a unique connection to a Redis server.

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 async fn close(self) -> Result<()>

if this client is the last client on the shared connection, the channel to send messages to the underlying network handler will be closed explicitely.

Then, this function will await for the network handler to be ended

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 fn get_client_state(&self) -> RwLockReadGuard<'_, ClientState>

Give an immutable generic access to attach any state to a client instance

source

pub fn get_client_state_mut(&self) -> RwLockWriteGuard<'_, ClientState>

Give a mutable generic access to attach any state to a client instance

source

pub async fn send( &self, command: Command, retry_on_error: Option<bool> ) -> Result<RespBuf>

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

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

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

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

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

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

    Ok(())
}
source

pub fn send_and_forget( &self, command: 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 async fn send_batch( &self, commands: Vec<Command>, retry_on_error: Option<bool> ) -> Result<Vec<RespBuf>>

Send a batch of commands to the Redis server.

§Arguments
  • commands - batch of generic Commands meant to be sent to the Redis server.
  • retry_on_error - retry to send the command batch on network error.
    • None - default behaviour defined in Config::retry_on_error
    • Some(true) - retry sending batch on network error
    • Some(false) - do not retry sending batch 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(&self) -> Pipeline<'_>

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<impl Stream<Item = Vec<String>>>

Trait Implementations§

source§

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

source§

fn bitcount<K>( self, key: K, range: BitRange ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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

fn bitfield<K, C, E, O>( self, key: K, sub_commands: C ) -> 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<K, C, E, O>( self, key: K, get_commands: C ) -> 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<D, K, KK>( self, operation: BitOperation, dest_key: D, keys: KK ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, KK: SingleArgCollection<K>,

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

fn bitpos<K>( self, key: K, bit: u64, range: BitRange ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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

fn getbit<K>(self, key: K, offset: u64) -> PreparedCommand<'a, Self, u64>
where Self: Sized, K: SingleArg,

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

fn setbit<K>( self, key: K, offset: u64, value: u64 ) -> PreparedCommand<'a, Self, u64>
where Self: Sized, K: SingleArg,

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

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

source§

async fn monitor(self) -> Result<MonitorStream>

Debugging command that streams back every command processed by the Redis server. Read more
source§

fn blmove<S, D, E>( self, source: S, destination: D, where_from: LMoveWhere, where_to: LMoveWhere, timeout: f64 ) -> PreparedCommand<'a, Self, E>
where Self: Sized, S: SingleArg, D: SingleArg, E: PrimitiveResponse,

This command is the blocking variant of lmove. Read more
source§

fn blmpop<K, KK, E>( self, timeout: f64, keys: KK, where_: LMoveWhere, count: usize ) -> PreparedCommand<'a, Self, Option<(String, Vec<E>)>>

This command is the blocking variant of lmpop. Read more
source§

fn blpop<K, KK, K1, V>( self, keys: KK, timeout: f64 ) -> PreparedCommand<'a, Self, Option<(K1, V)>>

This command is a blocking list pop primitive. Read more
source§

fn brpop<K, KK, K1, V>( self, keys: KK, timeout: f64 ) -> PreparedCommand<'a, Self, Option<(K1, V)>>

This command is a blocking list pop primitive. Read more
source§

fn bzmpop<K, KK, E>( self, timeout: f64, keys: KK, where_: ZWhere, count: usize ) -> PreparedCommand<'a, Self, Option<ZMPopResult<E>>>

This command is the blocking variant of zmpop. Read more
source§

fn bzpopmax<K, KK, E, K1>( self, keys: KK, timeout: f64 ) -> PreparedCommand<'a, Self, BZpopMinMaxResult<K1, E>>

This command is the blocking variant of zpopmax. Read more
source§

fn bzpopmin<K, KK, E, K1>( self, keys: KK, timeout: f64 ) -> PreparedCommand<'a, Self, BZpopMinMaxResult<K1, E>>

This command is the blocking variant of zpopmin. Read more
source§

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

Available on crate feature redis-bloom only.
source§

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

Adds an item to a bloom filter Read more
source§

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

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

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

Return information about key filter. Read more
source§

fn bf_info( self, key: impl SingleArg, param: BfInfoParameter ) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

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

fn bf_insert<I: SingleArg, R: CollectionResponse<bool>>( self, key: impl SingleArg, items: impl SingleArgCollection<I>, options: BfInsertOptions ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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

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

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

fn bf_madd<I: SingleArg, R: CollectionResponse<bool>>( self, key: impl SingleArg, items: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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<I: SingleArg, R: CollectionResponse<bool>>( self, key: impl SingleArg, items: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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

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

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 SingleArg, iterator: i64 ) -> PreparedCommand<'a, Self, BfScanDumpResult>
where Self: Sized,

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) -> Client

Returns a copy of the value. Read more
1.0.0 · 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 asking(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

When a cluster client receives an -ASK redirect, the ASKING command is sent to the target node followed by the command which was redirected. This is normally done automatically by cluster clients. Read more
source§

fn cluster_addslots<S>(self, slots: S) -> PreparedCommand<'a, Self, ()>
where Self: Sized, S: SingleArgCollection<u16>,

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

fn cluster_addslotsrange<S>(self, slots: S) -> PreparedCommand<'a, Self, ()>
where Self: Sized, S: KeyValueArgsCollection<u16, u16>,

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>
where Self: Sized,

Advances the cluster config epoch. Read more
source§

fn cluster_count_failure_reports<I>( self, node_id: I ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, I: SingleArg,

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>
where Self: Sized,

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

fn cluster_delslots<S>(self, slots: S) -> PreparedCommand<'a, Self, ()>
where Self: Sized, S: SingleArgCollection<u16>,

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<S>(self, slots: S) -> PreparedCommand<'a, Self, ()>
where Self: Sized, S: KeyValueArgsCollection<u16, u16>,

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: ClusterFailoverOption ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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, ()>
where Self: Sized,

Deletes all slots from a node. Read more
source§

fn cluster_forget<I>(self, node_id: I) -> PreparedCommand<'a, Self, ()>
where Self: Sized, I: SingleArg,

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( self, slot: u16, count: usize ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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, slot: u16, count: usize ) -> PreparedCommand<'a, Self, ClusterInfo>
where Self: Sized,

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

fn cluster_keyslot<K>(self, key: K) -> PreparedCommand<'a, Self, u16>
where Self: Sized, K: SingleArg,

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<IP>( self, ip: IP, port: u16, cluster_bus_port: Option<u16> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, IP: SingleArg,

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<N>(self) -> PreparedCommand<'a, Self, N>
where Self: Sized, N: PrimitiveResponse,

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

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

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<I, R>(self, node_id: I) -> PreparedCommand<'a, Self, R>
where Self: Sized, I: SingleArg, R: PrimitiveResponse,

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

fn cluster_replicate<I>(self, node_id: I) -> PreparedCommand<'a, Self, ()>
where Self: Sized, I: SingleArg,

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, ()>
where Self: Sized,

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, ()>
where Self: Sized,

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, ()>
where Self: Sized,

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, ()>
where Self: Sized,

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<S>(self) -> PreparedCommand<'a, Self, S>

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

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

This command returns details details about which cluster slots map to which Redis instances. Read more
source§

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

Enables read queries for a connection to a Redis Cluster replica node. Read more
source§

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

Disables read queries for a connection to a Redis Cluster replica node. Read more
source§

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

source§

fn auth<U, P>( self, username: Option<U>, password: P ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, U: SingleArg, P: SingleArg,

Authenticates the current connection. Read more
source§

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

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<CN>(self) -> PreparedCommand<'a, Self, Option<CN>>

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

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

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

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

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

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

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>
where Self: Sized,

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

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

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, ()>
where Self: Sized,

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

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

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, ()>
where Self: Sized,

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

fn client_setname<CN>( self, connection_name: CN ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, CN: SingleArg,

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

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

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>
where Self: Sized,

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>
where Self: Sized,

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>
where Self: Sized,

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

fn echo<M, R>(self, message: M) -> PreparedCommand<'a, Self, R>
where Self: Sized, M: SingleArg, R: PrimitiveResponse,

Returns message. Read more
source§

fn hello(self, options: HelloOptions) -> PreparedCommand<'a, Self, HelloResult>
where Self: Sized,

Switch to a different protocol, optionally authenticating and setting the connection’s name, or provide a contextual client report. Read more
source§

fn ping<R>(self, options: PingOptions) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: PrimitiveResponse,

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

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

Ask the server to close the connection. Read more
source§

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

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, ()>
where Self: Sized,

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

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

Available on crate feature redis-bloom only.
source§

fn cms_incrby<I: SingleArg, R: CollectionResponse<usize>>( self, key: impl SingleArg, items: impl KeyValueArgsCollection<I, usize> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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

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

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

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

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

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

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

fn cms_merge<S: SingleArg, W: SingleArgCollection<usize>>( self, destination: impl SingleArg, sources: impl SingleArgCollection<S>, weights: Option<W> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

fn cms_query<I: SingleArg, C: CollectionResponse<usize>>( self, key: impl SingleArg, items: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, C>
where Self: Sized,

Merges several sketches into one sketch. Read more
source§

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

Available on crate feature redis-bloom only.
source§

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

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

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

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

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

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

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

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

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

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

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

Return information about key Read more
source§

fn cf_insert<I: SingleArg>( self, key: impl SingleArg, options: CfInsertOptions, item: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, Vec<usize>>
where Self: Sized,

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<I: SingleArg, R: CollectionResponse<i64>>( self, key: impl SingleArg, options: CfInsertOptions, item: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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 SingleArg, iterator: i64, data: impl SingleArg ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

fn cf_mexists<I: SingleArg, R: CollectionResponse<bool>>( self, key: impl SingleArg, items: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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

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

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 SingleArg, iterator: i64 ) -> PreparedCommand<'a, Self, CfScanDumpResult>
where Self: Sized,

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 Drop for Client

source§

fn drop(&mut self)

if this client is the last client on the shared connection, the channel to send messages to the underlying network handler will be closed explicitely

source§

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

source§

fn copy<S, D>( self, source: S, destination: D, destination_db: Option<usize>, replace: bool ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, S: SingleArg, D: SingleArg,

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

fn del<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, C: SingleArgCollection<K>,

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

fn dump<K>(self, key: K) -> PreparedCommand<'a, Self, DumpResult>
where Self: Sized, K: SingleArg,

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

fn exists<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, C: SingleArgCollection<K>,

Returns if keys exist. Read more
source§

fn expire<K>( self, key: K, seconds: u64, option: ExpireOption ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg,

Set a timeout on key in seconds Read more
source§

fn expireat<K>( self, key: K, unix_time_seconds: u64, option: ExpireOption ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg,

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<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn keys<P, K, A>(self, pattern: P) -> PreparedCommand<'a, Self, A>

Returns all keys matching pattern. Read more
source§

fn migrate<H, K>( self, host: H, port: u16, key: K, destination_db: usize, timeout: u64, options: MigrateOptions ) -> PreparedCommand<'a, Self, MigrateResult>
where Self: Sized, H: SingleArg, K: SingleArg,

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

fn move_<K>(self, key: K, db: usize) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn object_encoding<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
where Self: Sized, K: SingleArg, E: PrimitiveResponse,

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

fn object_freq<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn object_idle_time<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn object_refcount<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn persist<K>(self, key: K) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg,

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<K>( self, key: K, milliseconds: u64, option: ExpireOption ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg,

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<K>( self, key: K, unix_time_milliseconds: u64, option: ExpireOption ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg,

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<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn pttl<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

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

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

fn rename<K1, K2>(self, key: K1, new_key: K2) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K1: SingleArg, K2: SingleArg,

Renames key to newkey. Read more
source§

fn renamenx<K1, K2>( self, key: K1, new_key: K2 ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K1: SingleArg, K2: SingleArg,

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

fn restore<K>( self, key: K, ttl: u64, serialized_value: Vec<u8>, options: RestoreOptions ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg,

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

fn scan<K, A>( self, cursor: u64, options: ScanOptions ) -> PreparedCommand<'a, Self, (u64, A)>

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

fn sort<K, M, A>( self, key: K, options: SortOptions ) -> PreparedCommand<'a, Self, A>

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

fn sort_and_store<K, D>( self, key: K, destination: D, options: SortOptions ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, D: SingleArg,

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

fn sort_readonly<K, M, A>( self, key: K, options: SortOptions ) -> PreparedCommand<'a, Self, A>

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

fn touch<K, KK>(self, keys: KK) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, KK: SingleArgCollection<K>,

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

fn ttl<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

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

fn type_<K>(self, key: K) -> PreparedCommand<'a, Self, String>
where Self: Sized, K: SingleArg,

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>
where Self: Sized,

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§

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

source§

fn geoadd<K, M, I>( self, key: K, condition: GeoAddCondition, change: bool, items: I ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, I: MultipleArgsCollection<(f64, f64, M)>,

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

fn geodist<K, M>( self, key: K, member1: M, member2: M, unit: GeoUnit ) -> PreparedCommand<'a, Self, Option<f64>>
where Self: Sized, K: SingleArg, M: SingleArg,

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

fn geohash<K, M, C>( self, key: K, members: C ) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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<K, M, C>( self, key: K, members: C ) -> PreparedCommand<'a, Self, Vec<Option<(f64, f64)>>>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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<K, M1, M2, A>( self, key: K, from: GeoSearchFrom<M1>, by: GeoSearchBy, options: GeoSearchOptions ) -> PreparedCommand<'a, Self, A>

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<D, S, M>( self, destination: D, source: S, from: GeoSearchFrom<M>, by: GeoSearchBy, options: GeoSearchStoreOptions ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, S: SingleArg, M: SingleArg,

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

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

Available on crate feature redis-graph only.
source§

fn graph_config_get<N, V, R>( self, name: impl SingleArg ) -> PreparedCommand<'a, Self, R>

Retrieves the current value of a RedisGraph configuration parameter. Read more
source§

fn graph_config_set( self, name: impl SingleArg, value: impl SingleArg ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Set the value of a RedisGraph configuration parameter. Read more
source§

fn graph_delete( self, graph: impl SingleArg ) -> PreparedCommand<'a, Self, String>
where Self: Sized,

Completely removes the graph and all of its entities. Read more
source§

fn graph_explain<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, graph: impl SingleArg, query: impl SingleArg ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Constructs a query execution plan but does not run it. Read more
source§

fn graph_list<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Lists all graph keys in the keyspace. Read more
source§

fn graph_profile<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, graph: impl SingleArg, query: impl SingleArg, options: GraphQueryOptions ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Executes a query and produces an execution plan augmented with metrics for each operation’s execution. Read more
source§

fn graph_query( self, graph: impl SingleArg, query: impl SingleArg, options: GraphQueryOptions ) -> PreparedCommand<'a, Self, GraphResultSet>
where Self: Sized,

Executes the given query against a specified graph. Read more
source§

fn graph_ro_query( self, graph: impl SingleArg, query: impl SingleArg, options: GraphQueryOptions ) -> PreparedCommand<'a, Self, GraphResultSet>
where Self: Sized,

Executes a given read only query against a specified graph Read more
source§

fn graph_slowlog<R: CollectionResponse<GraphSlowlogResult>>( self, graph: impl SingleArg ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Returns a list containing up to 10 of the slowest queries issued against the given graph ID. Read more
source§

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

source§

fn hdel<K, F, C>(self, key: K, fields: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, F: SingleArg, C: SingleArgCollection<F>,

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

fn hexists<K, F>(self, key: K, field: F) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, F: SingleArg,

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

fn hget<K, F, V>(self, key: K, field: F) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, F: SingleArg, V: PrimitiveResponse,

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

fn hgetall<K, F, V, A>(self, key: K) -> PreparedCommand<'a, Self, A>

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

fn hincrby<K, F>( self, key: K, field: F, increment: i64 ) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg, F: SingleArg,

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

fn hincrbyfloat<K, F>( self, key: K, field: F, increment: f64 ) -> PreparedCommand<'a, Self, f64>
where Self: Sized, K: SingleArg, F: SingleArg,

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<K, F, A>(self, key: K) -> PreparedCommand<'a, Self, A>

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

fn hlen<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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

fn hmget<K, F, V, C, A>(self, key: K, fields: C) -> PreparedCommand<'a, Self, A>

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

fn hrandfield<K, F>(self, key: K) -> PreparedCommand<'a, Self, F>
where Self: Sized, K: SingleArg, F: PrimitiveResponse,

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

fn hrandfields<K, F, A>( self, key: K, count: isize ) -> PreparedCommand<'a, Self, A>

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

fn hrandfields_with_values<K, F, V, A>( self, key: K, count: isize ) -> PreparedCommand<'a, Self, A>

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

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

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

fn hset<K, F, V, I>(self, key: K, items: I) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, F: SingleArg, V: SingleArg, I: KeyValueArgsCollection<F, V>,

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

fn hsetnx<K, F, V>( self, key: K, field: F, value: V ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, F: SingleArg, V: SingleArg,

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

fn hstrlen<K, F>(self, key: K, field: F) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, F: SingleArg,

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

fn hvals<K, V, A>(self, key: K) -> PreparedCommand<'a, Self, A>

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<K, E, EE>( self, key: K, elements: EE ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, E: SingleArg, EE: SingleArgCollection<E>,

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

fn pfcount<K, KK>(self, keys: KK) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, KK: SingleArgCollection<K>,

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

fn pfmerge<D, S, SS>( self, dest_key: D, source_keys: SS ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, D: SingleArg, S: SingleArg, SS: SingleArgCollection<S>,

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

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

Available on crate feature redis-json only.
source§

fn json_arrappend<K, P, V, VV, R>( self, key: K, path: P, values: VV ) -> 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<K, P, V, R>( self, key: K, path: P, value: V, 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<K, P, V, VV, R>( self, key: K, path: P, index: isize, values: VV ) -> 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<K, P, R>(self, key: K, path: P) -> PreparedCommand<'a, Self, R>

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

fn json_arrpop<K, P, R, RR>( self, key: K, path: P, index: isize ) -> PreparedCommand<'a, Self, RR>

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

fn json_arrtrim<K, P, R>( self, key: K, path: P, 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<K, P>(self, key: K, path: P) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, P: SingleArg,

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

fn json_debug_memory<K, P, R>( self, key: K, path: P ) -> PreparedCommand<'a, Self, R>

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

fn json_del<K, P>(self, key: K, path: P) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, P: SingleArg,

Delete a value Read more
source§

fn json_forget<K, P>(self, key: K, path: P) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, P: SingleArg,

source§

fn json_get<K, V>( self, key: K, options: JsonGetOptions ) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, V: PrimitiveResponse,

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

fn json_mget<K, KK, P, V, VV>( self, keys: KK, path: P ) -> PreparedCommand<'a, Self, VV>

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

fn json_numincrby<K, P, V, R>( self, key: K, path: P, value: V ) -> PreparedCommand<'a, Self, R>
where Self: Sized, K: SingleArg, P: SingleArg, V: SingleArg, R: PrimitiveResponse,

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

fn json_nummultby<K, P, V, R>( self, key: K, path: P, value: V ) -> PreparedCommand<'a, Self, R>
where Self: Sized, K: SingleArg, P: SingleArg, V: SingleArg, R: PrimitiveResponse,

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

fn json_objkeys<K, P, R, RR>( self, key: K, path: P ) -> PreparedCommand<'a, Self, RR>

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

fn json_objlen<K, P, R>(self, key: K, path: P) -> PreparedCommand<'a, Self, R>

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

fn json_resp<K, P, VV>(self, key: K, path: P) -> PreparedCommand<'a, Self, VV>
where Self: Sized, K: SingleArg, P: SingleArg, VV: CollectionResponse<Value>,

source§

fn json_set<K, P, V>( self, key: K, path: P, value: V, condition: SetCondition ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, P: SingleArg, V: SingleArg,

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

fn json_strappend<K, P, V, R>( self, key: K, path: P, value: V ) -> PreparedCommand<'a, Self, R>

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

fn json_strlen<K, P, R>(self, key: K, path: P) -> PreparedCommand<'a, Self, R>

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

fn json_toggle<K, P, R>(self, key: K, path: P) -> PreparedCommand<'a, Self, R>

Toggle a Boolean value stored at path Read more
source§

fn json_type<K, P, R, RR>( self, key: K, path: P ) -> PreparedCommand<'a, Self, RR>

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

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

source§

fn lindex<K, E>(self, key: K, index: isize) -> PreparedCommand<'a, Self, E>
where Self: Sized, K: SingleArg, E: PrimitiveResponse,

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

fn linsert<K, E>( self, key: K, where_: LInsertWhere, pivot: E, element: E ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg,

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

fn llen<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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

fn lmove<S, D, E>( self, source: S, destination: D, where_from: LMoveWhere, where_to: LMoveWhere ) -> PreparedCommand<'a, Self, E>
where Self: Sized, S: SingleArg, D: SingleArg, E: PrimitiveResponse,

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<K, E, C>( self, keys: C, where_: LMoveWhere, count: usize ) -> PreparedCommand<'a, Self, (String, Vec<E>)>

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

fn lpop<K, E, A>(self, key: K, count: usize) -> PreparedCommand<'a, Self, A>

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

fn lpos<K, E>( self, key: K, element: E, rank: Option<usize>, max_len: Option<usize> ) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized, K: SingleArg, E: SingleArg,

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

fn lpos_with_count<K, E, A>( self, key: K, element: E, num_matches: usize, rank: Option<usize>, max_len: Option<usize> ) -> PreparedCommand<'a, Self, A>

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

fn lpush<K, E, C>(self, key: K, elements: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

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

fn lpushx<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

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<K, E, A>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, A>

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

fn lrem<K, E>( self, key: K, count: isize, element: E ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg,

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

fn lset<K, E>( self, key: K, index: isize, element: E ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, E: SingleArg,

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

fn ltrim<K>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg,

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

fn rpop<K, E, C>(self, key: K, count: usize) -> PreparedCommand<'a, Self, C>

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

fn rpush<K, E, C>(self, key: K, elements: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

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

fn rpushx<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

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<C, CC>(self, channels: CC) -> Result<PubSubStream>
where C: SingleArg + Send + 'a, CC: SingleArgCollection<C>,

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

async fn psubscribe<P, PP>(self, patterns: PP) -> Result<PubSubStream>
where P: SingleArg + Send + 'a, PP: SingleArgCollection<P>,

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

async fn ssubscribe<C, CC>(self, shardchannels: CC) -> Result<PubSubStream>
where C: SingleArg + Send + 'a, CC: SingleArgCollection<C>,

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

fn publish<C, M>( self, channel: C, message: M ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, C: SingleArg, M: SingleArg,

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

fn pub_sub_channels<C, CC>( self, options: PubSubChannelsOptions ) -> PreparedCommand<'a, Self, CC>

Lists the currently active channels. Read more
source§

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

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<C, CC, R, RR>( self, channels: CC ) -> PreparedCommand<'a, Self, RR>

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

fn pub_sub_shardchannels<C, CC>( self, options: PubSubChannelsOptions ) -> PreparedCommand<'a, Self, CC>

Lists the currently active shard channels. Read more
source§

fn pub_sub_shardnumsub<C, CC, R, RR>( self, channels: CC ) -> PreparedCommand<'a, Self, RR>

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

fn spublish<C, M>( self, shardchannel: C, message: M ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, C: SingleArg, M: SingleArg,

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

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

source§

fn eval<R>(self, builder: CallBuilder) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: Response,

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

fn eval_readonly<R>(self, builder: CallBuilder) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: Response,

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

fn evalsha<R>(self, builder: CallBuilder) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: Response,

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

fn evalsha_readonly<R>( self, builder: CallBuilder ) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: Response,

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

fn fcall<R>(self, builder: CallBuilder) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: Response,

Invoke a function. Read more
source§

fn fcall_readonly<R>(self, builder: CallBuilder) -> PreparedCommand<'a, Self, R>
where Self: Sized, R: Response,

Invoke a function. Read more
source§

fn function_delete<L>(self, library_name: L) -> PreparedCommand<'a, Self, ()>
where Self: Sized, L: SingleArg,

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

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

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, ()>
where Self: Sized,

Deletes all the libraries. Read more
source§

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

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

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

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

fn function_load<F, L>( self, replace: bool, function_code: F ) -> PreparedCommand<'a, Self, L>
where Self: Sized, F: SingleArg, L: PrimitiveResponse,

Load a library to Redis. Read more
source§

fn function_restore<P>( self, serialized_payload: P, policy: FunctionRestorePolicy ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, P: SingleArg,

Restore libraries from the serialized payload. Read more
source§

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

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, ()>
where Self: Sized,

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

fn script_exists<S, C>(self, sha1s: C) -> PreparedCommand<'a, Self, Vec<bool>>
where Self: Sized, S: SingleArg, C: SingleArgCollection<S>,

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, ()>
where Self: Sized,

Flush the Lua scripts cache. Read more
source§

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

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

fn script_load<S, V>(self, script: S) -> PreparedCommand<'a, Self, V>
where Self: Sized, S: SingleArg, V: PrimitiveResponse,

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

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

Available on crate feature redis-search only.
source§

fn ft_aggregate<I, Q>( self, index: I, query: Q, options: FtAggregateOptions ) -> PreparedCommand<'a, Self, FtAggregateResult>
where Self: Sized, I: SingleArg, Q: SingleArg,

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<A, I>(self, alias: A, index: I) -> PreparedCommand<'a, Self, ()>
where Self: Sized, A: SingleArg, I: SingleArg,

Add an alias to an index Read more
source§

fn ft_aliasdel<A>(self, alias: A) -> PreparedCommand<'a, Self, ()>
where Self: Sized, A: SingleArg,

Remove an alias from an index Read more
source§

fn ft_aliasupdate<A, I>( self, alias: A, index: I ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, A: SingleArg, I: SingleArg,

Add an alias to an index. Read more
source§

fn ft_alter<I>( self, index: I, skip_initial_scan: bool, attribute: FtFieldSchema ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, I: SingleArg,

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

fn ft_config_get<O, N, V, R>(self, option: O) -> PreparedCommand<'a, Self, R>

Retrieve configuration options Read more
source§

fn ft_config_set<O, V>( self, option: O, value: V ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, O: SingleArg, V: SingleArg,

Set configuration options Read more
source§

fn ft_create<I, S>( self, index: I, options: FtCreateOptions, schema: S ) -> PreparedCommand<'a, Self, ()>

Create an index with the given specification Read more
source§

fn ft_cursor_del<I>( self, index: I, cursor_id: u64 ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, I: SingleArg,

Delete a cursor Read more
source§

fn ft_cursor_read<I>( self, index: I, cursor_id: u64 ) -> PreparedCommand<'a, Self, FtAggregateResult>
where Self: Sized, I: SingleArg,

Read next results from an existing cursor Read more
source§

fn ft_dictadd<D, T, TT>( self, dict: D, terms: TT ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, T: SingleArg, TT: SingleArgCollection<T>,

Add terms to a dictionary Read more
source§

fn ft_dictdel<D, T, TT>( self, dict: D, terms: TT ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, T: SingleArg, TT: SingleArgCollection<T>,

Delete terms from a dictionary Read more
source§

fn ft_dictdump<D, T, TT>(self, dict: D) -> PreparedCommand<'a, Self, TT>

Dump all terms in the given dictionary Read more
source§

fn ft_dropindex<I>(self, index: I, dd: bool) -> PreparedCommand<'a, Self, ()>
where Self: Sized, I: SingleArg,

Delete an index Read more
source§

fn ft_explain<I, Q, R>( self, index: I, query: Q, dialect_version: Option<u64> ) -> PreparedCommand<'a, Self, R>
where Self: Sized, I: SingleArg, Q: SingleArg, R: PrimitiveResponse,

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

fn ft_explaincli<I, Q, R, RR>( self, index: I, query: Q, dialect_version: Option<u64> ) -> PreparedCommand<'a, Self, RR>

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 SingleArg ) -> PreparedCommand<'a, Self, FtInfoResult>
where Self: Sized,

Return information and statistics on the index Read more
source§

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

Returns a list of all existing indexes. Read more
Perform a ft_search command and collects performance information Read more
source§

fn ft_profile_aggregate<I, Q, QQ>( self, index: I, limited: bool, query: QQ ) -> PreparedCommand<'a, Self, FtProfileAggregateResult>
where Self: Sized, I: SingleArg, Q: SingleArg, QQ: SingleArgCollection<Q>,

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<I, Q>( self, index: I, query: Q, options: FtSpellCheckOptions ) -> PreparedCommand<'a, Self, FtSpellCheckResult>
where Self: Sized, I: SingleArg, Q: SingleArg,

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

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

Dump the contents of a synonym group Read more
source§

fn ft_synupdate<T: SingleArg>( self, index: impl SingleArg, synonym_group_id: impl SingleArg, skip_initial_scan: bool, terms: impl SingleArgCollection<T> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Update a synonym group Read more
source§

fn ft_tagvals<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, index: impl SingleArg, field_name: impl SingleArg ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

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

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

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

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

Delete a string from a suggestion index Read more
source§

fn ft_sugget( self, key: impl SingleArg, prefix: impl SingleArg, options: FtSugGetOptions ) -> PreparedCommand<'a, Self, Vec<FtSuggestion>>
where Self: Sized,

Get completion suggestions for a prefix Read more
source§

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

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

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

source§

fn sentinel_config_get<N, RN, RV, R>( self, name: N ) -> PreparedCommand<'a, Self, R>

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

fn sentinel_config_set<N, V>( self, name: N, value: V ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg, V: SingleArg,

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

fn sentinel_ckquorum<N>(self, master_name: N) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg,

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<N>(self, master_name: N) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg,

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<N>( self, master_name: N ) -> PreparedCommand<'a, Self, Option<(String, u16)>>
where Self: Sized, N: SingleArg,

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

fn sentinel_info_cache<N, NN, R>( self, master_names: NN ) -> PreparedCommand<'a, Self, R>

Return cached info output from masters and replicas.
source§

fn sentinel_master<N>( self, master_name: N ) -> PreparedCommand<'a, Self, SentinelMasterInfo>
where Self: Sized, N: SingleArg,

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<N, I>( self, name: N, ip: I, port: u16, quorum: usize ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg, I: SingleArg,

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<N>(self, name: N) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg,

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

fn sentinel_set<N, O, V, C>( self, name: N, configs: C ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg, O: SingleArg, V: SingleArg, C: KeyValueArgsCollection<O, V>,

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>
where Self: Sized,

Return the ID of the Sentinel instance.
source§

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

This command returns information about pending scripts.
source§

fn sentinel_replicas<N>( self, master_name: N ) -> PreparedCommand<'a, Self, Vec<SentinelReplicaInfo>>
where Self: Sized, N: SingleArg,

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

fn sentinel_reset<P>(self, pattern: P) -> PreparedCommand<'a, Self, usize>
where Self: Sized, P: SingleArg,

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

fn sentinel_sentinels<N>( self, master_name: N ) -> PreparedCommand<'a, Self, Vec<SentinelInfo>>
where Self: Sized, N: SingleArg,

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<C, CC>(self, options: AclCatOptions) -> PreparedCommand<'a, Self, CC>

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<U, UU>(self, usernames: UU) -> PreparedCommand<'a, Self, usize>
where Self: Sized, U: SingleArg, UU: SingleArgCollection<U>,

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

fn acl_dryrun<U, C, R>( self, username: U, command: C, options: AclDryRunOptions ) -> PreparedCommand<'a, Self, R>
where Self: Sized, U: SingleArg, C: SingleArg, R: PrimitiveResponse,

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

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

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<U, RR>(self, username: U) -> PreparedCommand<'a, Self, RR>

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

fn acl_list(self) -> PreparedCommand<'a, Self, Vec<String>>
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<EE>( self, options: AclLogOptions ) -> PreparedCommand<'a, Self, Vec<EE>>

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<U, R, RR>( self, username: U, rules: RR ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, U: SingleArg, R: SingleArg, RR: SingleArgCollection<R>,

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

fn acl_users<U, UU>(self) -> PreparedCommand<'a, Self, UU>

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<U: PrimitiveResponse>(self) -> PreparedCommand<'a, Self, U>
where Self: Sized,

Return the username the current connection is authenticated with. 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<N, NN, DD>( self, command_names: NN ) -> PreparedCommand<'a, Self, DD>

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

fn command_getkeys<A, AA, KK>(self, args: AA) -> PreparedCommand<'a, Self, KK>

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

fn command_getkeysandflags<A, AA, KK>( self, args: AA ) -> PreparedCommand<'a, Self, KK>

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_info<N, NN>( self, command_names: NN ) -> PreparedCommand<'a, Self, Vec<CommandInfo>>
where Self: Sized, N: SingleArg, NN: SingleArgCollection<N>,

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

fn command_list<CC>( self, options: CommandListOptions ) -> PreparedCommand<'a, Self, CC>
where Self: Sized, CC: CollectionResponse<String>,

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

fn config_get<P, PP, V, VV>(self, params: PP) -> PreparedCommand<'a, Self, VV>

Used to read the configuration parameters of a running Redis server. 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<P, V, C>(self, configs: C) -> PreparedCommand<'a, Self, ()>
where Self: Sized, P: SingleArg, V: SingleArg, C: KeyValueArgsCollection<P, V>,

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: FlushingMode) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

fn flushall(self, flushing_mode: 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<SS>(self, sections: SS) -> PreparedCommand<'a, Self, String>

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 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(self) -> PreparedCommand<'a, Self, String>
where Self: Sized,

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

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

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

fn latency_histogram<C, CC, RR>( self, commands: CC ) -> PreparedCommand<'a, Self, RR>

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<RR>( self, event: LatencyHistoryEvent ) -> PreparedCommand<'a, Self, RR>
where Self: Sized, RR: CollectionResponse<(u32, u32)>,

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

fn latency_latest<RR>(self) -> PreparedCommand<'a, Self, RR>
where Self: Sized, RR: CollectionResponse<(String, u32, u32, u32)>,

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

fn latency_reset<EE>(self, events: EE) -> 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_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<K>( self, key: K, options: MemoryUsageOptions ) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized, K: SingleArg,

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<MM>(self) -> PreparedCommand<'a, Self, MM>

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

fn module_load<P>( self, path: P, options: ModuleLoadOptions ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, P: SingleArg,

Loads a module from a dynamic library at runtime. Read more
source§

fn module_unload<N>(self, name: N) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg,

Unloads a module. 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: SlowLogOptions ) -> PreparedCommand<'a, Self, Vec<SlowLogEntry>>
where Self: Sized,

This command returns entries from the slow log in chronological order. 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<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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

fn scard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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

fn sdiff<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A>

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

fn sdiffstore<D, K, C>( self, destination: D, keys: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

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

fn sinter<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A>

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

fn sintercard<K, C>( self, keys: C, limit: usize ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, C: SingleArgCollection<K>,

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<D, K, C>( self, destination: D, keys: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

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

fn sismember<K, M>(self, key: K, member: M) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, M: SingleArg,

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

fn smembers<K, M, A>(self, key: K) -> PreparedCommand<'a, Self, A>

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

fn smismember<K, M, C>( self, key: K, members: C ) -> PreparedCommand<'a, Self, Vec<bool>>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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

fn smove<S, D, M>( self, source: S, destination: D, member: M ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, S: SingleArg, D: SingleArg, M: SingleArg,

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

fn spop<K, M, A>(self, key: K, count: usize) -> PreparedCommand<'a, Self, A>

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

fn srandmember<K, M, A>( self, key: K, count: usize ) -> PreparedCommand<'a, Self, A>

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

fn srem<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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

fn sscan<K, M>( self, key: K, cursor: u64, options: SScanOptions ) -> PreparedCommand<'a, Self, (u64, Vec<M>)>

Iterates elements of Sets types. Read more
source§

fn sunion<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A>

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

fn sunionstore<D, K, C>( self, destination: D, keys: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

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<K, M, I>( self, key: K, items: I, options: ZAddOptions ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, I: MultipleArgsCollection<(f64, M)>,

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

fn zadd_incr<K, M>( self, key: K, condition: ZAddCondition, comparison: ZAddComparison, change: bool, score: f64, member: M ) -> PreparedCommand<'a, Self, Option<f64>>
where Self: Sized, K: SingleArg, M: SingleArg,

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

fn zcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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

fn zcount<K, M1, M2>( self, key: K, min: M1, max: M2 ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M1: SingleArg, M2: SingleArg,

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

fn zdiff<K, C, E>(self, keys: C) -> PreparedCommand<'a, Self, Vec<E>>

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<K, C, E>( self, keys: C ) -> PreparedCommand<'a, Self, Vec<(E, f64)>>

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<D, K, C>( self, destination: D, keys: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

Computes the difference between the first and all successive input sorted sets and stores the result in destination. Read more
source§

fn zincrby<K, M>( self, key: K, increment: f64, member: M ) -> PreparedCommand<'a, Self, f64>
where Self: Sized, K: SingleArg, M: SingleArg,

Increments the score of member in the sorted set stored at key by increment. Read more
source§

fn zinter<K, C, W, E>( self, keys: C, weights: Option<W>, aggregate: ZAggregate ) -> PreparedCommand<'a, Self, Vec<E>>

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<K, C, W, E>( self, keys: C, weights: Option<W>, aggregate: ZAggregate ) -> PreparedCommand<'a, Self, Vec<(E, f64)>>

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<K, C>( self, keys: C, limit: usize ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, C: SingleArgCollection<K>,

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<D, K, C, W>( self, destination: D, keys: C, weights: Option<W>, aggregate: 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<K, M1, M2>( self, key: K, min: M1, max: M2 ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M1: SingleArg, M2: SingleArg,

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<K, C, E>( self, keys: C, where_: ZWhere, count: usize ) -> PreparedCommand<'a, Self, Option<ZMPopResult<E>>>

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<K, M, C>( self, key: K, members: C ) -> PreparedCommand<'a, Self, Vec<Option<f64>>>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

Returns the scores associated with the specified members in the sorted set stored at key. Read more
source§

fn zpopmax<K, M>( self, key: K, count: usize ) -> PreparedCommand<'a, Self, Vec<(M, f64)>>

Removes and returns up to count members with the highest scores in the sorted set stored at key. Read more
source§

fn zpopmin<K, M>( self, key: K, count: usize ) -> PreparedCommand<'a, Self, Vec<(M, f64)>>

Removes and returns up to count members with the lowest scores in the sorted set stored at key. Read more
source§

fn zrandmember<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
where Self: Sized, K: SingleArg, E: PrimitiveResponse,

Return a random element from the sorted set value stored at key. Read more
source§

fn zrandmembers<K, E>( self, key: K, count: isize ) -> PreparedCommand<'a, Self, Vec<E>>

Return random elements from the sorted set value stored at key. Read more
source§

fn zrandmembers_with_scores<K, E>( self, key: K, count: isize ) -> PreparedCommand<'a, Self, Vec<E>>
where Self: Sized, K: SingleArg, E: DeserializeOwned,

Return random elements with their scores from the sorted set value stored at key. Read more
source§

fn zrange<K, S, E>( self, key: K, start: S, stop: S, options: ZRangeOptions ) -> PreparedCommand<'a, Self, Vec<E>>

Returns the specified range of elements in the sorted set stored at key. Read more
source§

fn zrange_with_scores<K, S, E>( self, key: K, start: S, stop: S, options: ZRangeOptions ) -> PreparedCommand<'a, Self, Vec<(E, f64)>>

Returns the specified range of elements in the sorted set stored at key. Read more
source§

fn zrangestore<D, S, SS>( self, dst: D, src: S, start: SS, stop: SS, options: ZRangeOptions ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, S: SingleArg, SS: SingleArg,

This command is like zrange, but stores the result in the dst destination key. Read more
source§

fn zrank<K, M>( self, key: K, member: M ) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized, K: SingleArg, M: SingleArg,

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<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

Removes the specified members from the sorted set stored at key. Read more
source§

fn zremrangebylex<K, S>( self, key: K, start: S, stop: S ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, S: SingleArg,

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<K>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

Removes all elements in the sorted set stored at key with rank between start and stop. Read more
source§

fn zremrangebyscore<K, S>( self, key: K, start: S, stop: S ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, S: SingleArg,

Removes all elements in the sorted set stored at key with a score between min and max (inclusive). Read more
source§

fn zrevrank<K, M>( self, key: K, member: M ) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized, K: SingleArg, M: SingleArg,

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<K, M>( self, key: K, cursor: usize, options: ZScanOptions ) -> PreparedCommand<'a, Self, ZScanResult<M>>

Iterates elements of Sorted Set types and their associated scores. Read more
source§

fn zscore<K, M>( self, key: K, member: M ) -> PreparedCommand<'a, Self, Option<f64>>
where Self: Sized, K: SingleArg, M: SingleArg,

Returns the score of member in the sorted set at key. Read more
source§

fn zunion<K, C, W, E>( self, keys: C, weights: Option<W>, aggregate: ZAggregate ) -> PreparedCommand<'a, Self, Vec<E>>

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<K, C, W, E>( self, keys: C, weights: Option<W>, aggregate: ZAggregate ) -> PreparedCommand<'a, Self, Vec<(E, f64)>>

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<D, K, C, W>( self, destination: D, keys: C, weights: Option<W>, aggregate: 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<K, G, I, II>( self, key: K, group: G, ids: II ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg, II: SingleArgCollection<I>,

The XACK command removes one or multiple messages from the Pending Entries List (PEL) of a stream consumer group Read more
source§

fn xadd<K, I, F, V, FFVV, R>( self, key: K, stream_id: I, items: FFVV, options: XAddOptions ) -> PreparedCommand<'a, Self, R>

Appends the specified stream entry to the stream at the specified key. Read more
source§

fn xautoclaim<K, G, C, I, V>( self, key: K, group: G, consumer: C, min_idle_time: u64, start: I, options: XAutoClaimOptions ) -> PreparedCommand<'a, Self, XAutoClaimResult<V>>

This command transfers ownership of pending stream entries that match the specified criteria. Read more
source§

fn xclaim<K, G, C, I, II, V>( self, key: K, group: G, consumer: C, min_idle_time: u64, ids: II, options: XClaimOptions ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>>

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<K, I, II>(self, key: K, ids: II) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, I: SingleArg, II: SingleArgCollection<I>,

Removes the specified entries from a stream, and returns the number of entries deleted. Read more
source§

fn xgroup_create<K, G, I>( self, key: K, groupname: G, id: I, options: XGroupCreateOptions ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg,

This command creates a new consumer group uniquely identified by groupname for the stream stored at key. Read more
source§

fn xgroup_createconsumer<K, G, C>( self, key: K, groupname: G, consumername: C ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg,

Create a consumer named consumername in the consumer group groupname`` of the stream that's stored at key. Read more
source§

fn xgroup_delconsumer<K, G, C>( self, key: K, groupname: G, consumername: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg,

The XGROUP DELCONSUMER command deletes a consumer from the consumer group. Read more
source§

fn xgroup_destroy<K, G>( self, key: K, groupname: G ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, G: SingleArg,

The XGROUP DESTROY command completely destroys a consumer group. Read more
source§

fn xgroup_setid<K, G, I>( self, key: K, groupname: G, id: I, entries_read: Option<usize> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg,

Set the last delivered ID for a consumer group. Read more
source§

fn xinfo_consumers<K, G>( self, key: K, groupname: G ) -> PreparedCommand<'a, Self, Vec<XConsumerInfo>>
where Self: Sized, K: SingleArg, G: SingleArg,

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<K>(self, key: K) -> PreparedCommand<'a, Self, Vec<XGroupInfo>>
where Self: Sized, K: SingleArg,

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_stream<K>( self, key: K, options: XInfoStreamOptions ) -> PreparedCommand<'a, Self, XStreamInfo>
where Self: Sized, K: SingleArg,

This command returns information about the stream stored at key. Read more
source§

fn xlen<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

Returns the number of entries inside a stream. Read more
source§

fn xpending<K, G>( self, key: K, group: G ) -> PreparedCommand<'a, Self, XPendingResult>
where Self: Sized, K: SingleArg, G: SingleArg,

The XPENDING command is the interface to inspect the list of pending messages. Read more
source§

fn xpending_with_options<K, G>( self, key: K, group: G, options: XPendingOptions ) -> PreparedCommand<'a, Self, Vec<XPendingMessageResult>>
where Self: Sized, K: SingleArg, G: SingleArg,

The XPENDING command is the interface to inspect the list of pending messages. Read more
source§

fn xrange<K, S, E, V>( self, key: K, start: S, end: E, count: Option<usize> ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>>

The command returns the stream entries matching a given range of IDs. Read more
source§

fn xread<K, KK, I, II, V, R>( self, options: XReadOptions, keys: KK, ids: II ) -> 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<G, C, K, KK, I, II, V, R>( self, group: G, consumer: C, options: XReadGroupOptions, keys: KK, ids: II ) -> 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<K, E, S, V>( self, key: K, end: E, start: S, count: Option<usize> ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>>

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<K>( self, key: K, options: XTrimOptions ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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<K, V>(self, key: K, value: V) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, V: SingleArg,

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<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

Decrements the number stored at key by one. Read more
source§

fn decrby<K>(self, key: K, decrement: i64) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

Decrements the number stored at key by one. Read more
source§

fn get<K, V>(self, key: K) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, V: PrimitiveResponse,

Get the value of key. Read more
source§

fn getdel<K, V>(self, key: K) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, V: PrimitiveResponse,

Get the value of key and delete the key. Read more
source§

fn getex<K, V>( self, key: K, options: GetExOptions ) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, V: PrimitiveResponse,

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<K, V>( self, key: K, start: usize, end: isize ) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, V: PrimitiveResponse,

Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive). Read more
source§

fn getset<K, V, R>(self, key: K, value: V) -> PreparedCommand<'a, Self, R>
where Self: Sized, K: SingleArg, V: SingleArg, R: PrimitiveResponse,

Atomically sets key to value and returns the old value stored at key. Returns an error when key exists but does not hold a string value. Any previous time to live associated with the key is discarded on successful SET operation. Read more
source§

fn incr<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

Increments the number stored at key by one. Read more
source§

fn incrby<K>(self, key: K, increment: i64) -> PreparedCommand<'a, Self, i64>
where Self: Sized, K: SingleArg,

Increments the number stored at key by increment. Read more
source§

fn incrbyfloat<K>( self, key: K, increment: f64 ) -> PreparedCommand<'a, Self, f64>
where Self: Sized, K: SingleArg,

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<K, V>(self, key1: K, key2: K) -> PreparedCommand<'a, Self, V>
where Self: Sized, K: SingleArg, V: PrimitiveResponse,

The LCS command implements the longest common subsequence algorithm Read more
source§

fn lcs_len<K>(self, key1: K, key2: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

The LCS command implements the longest common subsequence algorithm Read more
source§

fn lcs_idx<K>( self, key1: K, key2: K, min_match_len: Option<usize>, with_match_len: bool ) -> PreparedCommand<'a, Self, LcsResult>
where Self: Sized, K: SingleArg,

The LCS command implements the longest common subsequence algorithm Read more
source§

fn mget<K, KK, V, VV>(self, keys: KK) -> PreparedCommand<'a, Self, VV>

Returns the values of all specified keys. Read more
source§

fn mset<K, V, C>(self, items: C) -> PreparedCommand<'a, Self, ()>
where Self: Sized, C: KeyValueArgsCollection<K, V>, K: SingleArg, V: SingleArg,

Sets the given keys to their respective values. Read more
source§

fn msetnx<K, V, C>(self, items: C) -> PreparedCommand<'a, Self, bool>
where Self: Sized, C: KeyValueArgsCollection<K, V>, K: SingleArg, V: SingleArg,

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 psetex<K, V>( self, key: K, milliseconds: u64, value: V ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, V: SingleArg,

Works exactly like setex with the sole difference that the expire time is specified in milliseconds instead of seconds. Read more
source§

fn set<K, V>(self, key: K, value: V) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, V: SingleArg,

Set key to hold the string value. Read more
source§

fn set_with_options<K, V>( self, key: K, value: V, condition: SetCondition, expiration: SetExpiration, keep_ttl: bool ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, V: SingleArg,

Set key to hold the string value. Read more
source§

fn set_get_with_options<K, V1, V2>( self, key: K, value: V1, condition: SetCondition, expiration: SetExpiration, keep_ttl: bool ) -> PreparedCommand<'a, Self, V2>
where Self: Sized, K: SingleArg, V1: SingleArg, V2: PrimitiveResponse,

Set key to hold the string value wit GET option enforced Read more
source§

fn setex<K, V>( self, key: K, seconds: u64, value: V ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, V: SingleArg,

Set key to hold the string value and set key to timeout after a given number of seconds. Read more
source§

fn setnx<K, V>(self, key: K, value: V) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, V: SingleArg,

Set key to hold string value if key does not exist. Read more
source§

fn setrange<K, V>( self, key: K, offset: usize, value: V ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, V: SingleArg,

Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. Read more
source§

fn strlen<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

Returns the length of the string value stored at key. Read more
source§

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

Available on crate feature redis-bloom only.
source§

fn tdigest_add( self, key: impl SingleArg, values: impl SingleArgCollection<f64> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Adds one or more observations to a t-digest sketch. Read more
source§

fn tdigest_byrank<R: CollectionResponse<f64>>( self, key: impl SingleArg, ranks: impl SingleArgCollection<usize> ) -> 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: CollectionResponse<f64>>( self, key: impl SingleArg, ranks: impl SingleArgCollection<usize> ) -> 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<V: SingleArg, R: CollectionResponse<f64>>( self, key: impl SingleArg, values: impl SingleArgCollection<V> ) -> 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 SingleArg, 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 SingleArg ) -> 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 SingleArg) -> PreparedCommand<'a, Self, f64>
where Self: Sized,

Returns the maximum observation value from a t-digest sketch. Read more
source§

fn tdigest_merge<S: SingleArg>( self, destination: impl SingleArg, sources: impl SingleArgCollection<S>, 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 SingleArg) -> PreparedCommand<'a, Self, f64>
where Self: Sized,

Returns the minimum observation value from a t-digest sketch. Read more
source§

fn tdigest_quantile<Q: SingleArg, R: CollectionResponse<f64>>( self, key: impl SingleArg, quantiles: impl SingleArgCollection<Q> ) -> 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<V: SingleArg, R: CollectionResponse<isize>>( self, key: impl SingleArg, values: impl SingleArgCollection<V> ) -> 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 SingleArg) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Resets a t-digest sketch: empty the sketch and re-initializes it. Read more
source§

fn tdigest_revrank<V: SingleArg, R: CollectionResponse<isize>>( self, key: impl SingleArg, values: impl SingleArgCollection<V> ) -> 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 SingleArg, 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

Available on crate feature redis-time-series only.
source§

fn ts_add( self, key: impl SingleArg, timestamp: impl SingleArg, value: f64, options: TsAddOptions ) -> PreparedCommand<'a, Self, u64>
where Self: Sized,

Append a sample to a time series Read more
source§

fn ts_alter( self, key: impl SingleArg, options: TsCreateOptions ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Update the retention, chunk size, duplicate policy, and labels of an existing time series Read more
source§

fn ts_create( self, key: impl SingleArg, options: TsCreateOptions ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Create a new time series Read more
source§

fn ts_createrule( self, src_key: impl SingleArg, dst_key: impl SingleArg, aggregator: TsAggregationType, bucket_duration: u64, options: TsCreateRuleOptions ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Create a compaction rule Read more
source§

fn ts_decrby( self, key: impl SingleArg, value: f64, options: TsIncrByDecrByOptions ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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 SingleArg, from_timestamp: u64, to_timestamp: u64 ) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

Delete all samples between two timestamps for a given time series Read more
source§

fn ts_deleterule( self, src_key: impl SingleArg, dst_key: impl SingleArg ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Delete a compaction rule Read more
source§

fn ts_get( self, key: impl SingleArg, options: TsGetOptions ) -> PreparedCommand<'a, Self, Option<(u64, f64)>>
where Self: Sized,

Get the last sample Read more
source§

fn ts_incrby( self, key: impl SingleArg, value: f64, options: TsIncrByDecrByOptions ) -> PreparedCommand<'a, Self, u64>
where Self: Sized,

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 SingleArg, debug: bool ) -> PreparedCommand<'a, Self, TsInfoResult>
where Self: Sized,

Return information and statistics for a time series. Read more
source§

fn ts_madd<K: SingleArg, T: SingleArg, R: CollectionResponse<u64>>( self, items: impl MultipleArgsCollection<(K, T, f64)> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Append new samples to one or more time series Read more
source§

fn ts_mget<F: SingleArg, R: CollectionResponse<TsSample>>( self, options: TsMGetOptions, filters: impl SingleArgCollection<F> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Get the last samples matching a specific filter Read more
source§

fn ts_mrange<F: SingleArg, R: CollectionResponse<TsRangeSample>>( self, from_timestamp: impl SingleArg, to_timestamp: impl SingleArg, options: TsMRangeOptions, filters: impl SingleArgCollection<F>, groupby_options: TsGroupByOptions ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Query a range across multiple time series by filters in forward direction Read more
source§

fn ts_mrevrange<F: SingleArg, R: CollectionResponse<TsRangeSample>>( self, from_timestamp: impl SingleArg, to_timestamp: impl SingleArg, options: TsMRangeOptions, filters: impl SingleArgCollection<F>, groupby_options: TsGroupByOptions ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Query a range across multiple time series by filters in reverse direction Read more
source§

fn ts_queryindex<F: SingleArg, R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, filters: impl SingleArgCollection<F> ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Get all time series keys matching a filter list Read more
source§

fn ts_range<R: CollectionResponse<(u64, f64)>>( self, key: impl SingleArg, from_timestamp: impl SingleArg, to_timestamp: impl SingleArg, options: TsRangeOptions ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Query a range in forward direction Read more
source§

fn ts_revrange<R: CollectionResponse<(u64, f64)>>( self, key: impl SingleArg, from_timestamp: impl SingleArg, to_timestamp: impl SingleArg, options: TsRangeOptions ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Query a range in reverse direction Read more
source§

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

Available on crate feature redis-bloom only.
source§

fn topk_add<I: SingleArg, R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, key: impl SingleArg, items: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Adds an item to the data structure. Read more
source§

fn topk_incrby<I: SingleArg, R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, key: impl SingleArg, items: impl KeyValueArgsCollection<I, i64> ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Increase the score of an item in the data structure by increment. Read more
source§

fn topk_info( self, key: impl SingleArg ) -> PreparedCommand<'a, Self, TopKInfoResult>
where Self: Sized,

Returns number of required items (k), width, depth and decay values. Read more
source§

fn topk_list<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>( self, key: impl SingleArg ) -> PreparedCommand<'a, Self, RR>
where Self: Sized,

Return full list of items in Top K list. Read more
source§

fn topk_list_with_count<N: PrimitiveResponse + DeserializeOwned>( self, key: impl SingleArg ) -> PreparedCommand<'a, Self, TopKListWithCountResult<N>>
where Self: Sized,

Return full list of items in Top K list. Read more
source§

fn topk_query<I: SingleArg, R: CollectionResponse<bool>>( self, key: impl SingleArg, items: impl SingleArgCollection<I> ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

Return full list of items in Top K list. Read more
source§

fn topk_reserve( self, key: impl SingleArg, topk: usize, width_depth_decay: Option<(usize, usize, f64)> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Initializes a TopK with specified parameters. Read more
source§

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

source§

fn watch<K, KK>(self, keys: KK) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, KK: SingleArgCollection<K>,

Marks the given keys to be watched for conditional execution of a transaction. Read more
source§

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

Flushes all the previously watched keys for a transaction. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more