Struct fred::clients::RedisPool

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

A cheaply cloneable round-robin client pool.

§Restrictions

The following interfaces are not implemented on RedisPool:

In many cases, such as publish, callers can work around this by adding a call to next, but in some scenarios this may not work. As a general rule, any commands that change or depend on local connection state will not be implemented directly on RedisPool. Callers can use clients, next, or last to operate on individual clients if needed.

Implementations§

source§

impl RedisPool

source

pub fn from_clients(clients: Vec<RedisClient>) -> Result<Self, RedisError>

Create a new pool from an existing set of clients.

source

pub fn new( config: RedisConfig, perf: Option<PerformanceConfig>, connection: Option<ConnectionConfig>, policy: Option<ReconnectPolicy>, size: usize, ) -> Result<Self, RedisError>

Create a new pool without connecting to the server.

See the builder interface for more information.

source

pub fn prefer_connected(&self, val: bool) -> bool

Set whether the client will use next_connected or next when routing commands among the pooled clients.

source

pub fn clients(&self) -> &[RedisClient]

Read the individual clients in the pool.

source

pub fn connect_pool(&self) -> Vec<ConnectHandle>

Connect each client to the server, returning the task driving each connection.

Use the base connect function to return one handle that drives all connections via join.

source

pub fn size(&self) -> usize

Read the size of the pool.

source

pub fn next_connected(&self) -> &RedisClient

Read the next connected client that should run the next command.

source

pub fn next(&self) -> &RedisClient

Read the client that should run the next command.

source

pub fn last(&self) -> &RedisClient

Read the client that ran the last command.

source

pub fn replicas(&self) -> Replicas

Available on crate feature replicas only.

Create a client that interacts with the replica nodes associated with the next client.

Trait Implementations§

source§

impl AclInterface for RedisPool

Available on crate feature i-acl only.
source§

fn acl_setuser<S, V>( &self, username: S, rules: V, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>, V: TryInto<MultipleValues>, V::Error: Into<RedisError>,

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

fn acl_load(&self) -> impl Future<Output = RedisResult<()>>

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_save(&self) -> impl Future<Output = RedisResult<()>>

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_list<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn acl_users<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn acl_getuser<R, S>(&self, username: S) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

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

fn acl_deluser<R, S>( &self, usernames: S, ) -> impl Future<Output = RedisResult<R>>

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

fn acl_cat<R>( &self, category: Option<Str>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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_genpass<R>( &self, bits: Option<u16>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Generate a password with length bits, returning the password. Read more
source§

fn acl_whoami<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the username the current connection is authenticated with. New connections are authenticated with the “default” user. Read more
source§

fn acl_log_count<R>( &self, count: Option<u32>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Read count recent ACL security events. Read more
source§

fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>

Clear the ACL security events logs. Read more
source§

impl ClientInterface for RedisPool

Available on crate feature i-client only.
source§

fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the ID of the current connection. Read more
source§

fn connection_ids(&self) -> impl Future<Output = HashMap<Server, i64>>

Read the connection IDs for the active connections to each server. Read more
source§

fn client_info<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn client_kill<R>( &self, filters: Vec<ClientKillFilter>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Close a given connection or set of connections. Read more
source§

fn client_list<R, I>( &self, type: Option<ClientKillType>, ids: Option<Vec<String>>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

The CLIENT LIST command returns information and statistics about the client connections server in a mostly human readable format. Read more
source§

fn client_getname<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

The CLIENT GETNAME returns the name of the current connection as set by CLIENT SETNAME. Read more
source§

fn client_setname<S>(&self, name: S) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

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

fn client_pause( &self, timeout: i64, mode: Option<ClientPauseKind>, ) -> impl Future<Output = RedisResult<()>>

CLIENT PAUSE is a connections control command able to suspend all the Redis clients for the specified amount of time (in milliseconds). Read more
source§

fn client_unpause(&self) -> impl Future<Output = RedisResult<()>>

CLIENT UNPAUSE is used to resume command processing for all clients that were paused by CLIENT PAUSE. Read more
source§

fn client_reply( &self, flag: ClientReplyFlag, ) -> impl Future<Output = RedisResult<()>>

The CLIENT REPLY command controls whether the server will reply the client’s commands. The following modes are available: Read more
source§

fn client_unblock<R, S>( &self, id: S, flag: Option<ClientUnblockFlag>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisValue>,

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 unblock_self( &self, flag: Option<ClientUnblockFlag>, ) -> impl Future<Output = RedisResult<()>>

A convenience function to unblock any blocked connection on this client.
source§

fn client_tracking<R, T, P>( &self, toggle: T, redirect: Option<i64>, prefixes: P, bcast: bool, optin: bool, optout: bool, noloop: bool, ) -> impl Future<Output = RedisResult<R>>

Available on crate feature i-tracking only.
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<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Available on crate feature i-tracking only.
The command returns information about the current client connection’s use of the server assisted client side caching feature. Read more
source§

fn client_getredir<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Available on crate feature i-tracking only.
This command returns the client ID we are redirecting our tracking notifications to. Read more
source§

fn client_caching<R>( &self, enabled: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Available on crate feature i-tracking only.
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§

impl ClientLike for RedisPool

source§

fn update_perf_config(&self, config: PerformanceConfig)

Update the internal PerformanceConfig on each client in place with new values.

source§

fn active_connections( &self, ) -> impl Future<Output = Result<Vec<Server>, RedisError>>

Read the set of active connections across all clients in the pool.

source§

fn set_resolver(&self, resolver: Rc<dyn Resolve>) -> impl Future

Available on crate feature dns only.

Override the DNS resolution logic for all clients in the pool.

source§

fn connect(&self) -> ConnectHandle

Connect each client to the server.

This function returns a JoinHandle to a task that drives all connections via join.

See connect_pool for a variation of this function that separates the connection tasks.

See init for an alternative shorthand.

source§

fn force_reconnection(&self) -> impl Future<Output = RedisResult<()>>

Force a reconnection to the server(s) for each client.

When running against a cluster this function will also refresh the cached cluster routing table.

source§

fn wait_for_connect(&self) -> impl Future<Output = RedisResult<()>>

Wait for all the clients to connect to the server.

source§

fn init(&self) -> impl Future<Output = RedisResult<ConnectHandle>>

Initialize a new routing and connection task for each client and wait for them to connect successfully.

The returned ConnectHandle refers to the task that drives the routing and connection layer for each client via join. It will not finish until the max reconnection count is reached.

Callers can also use connect and wait_for_connect separately if needed.

use fred::prelude::*;

#[tokio::main]
async fn main() -> Result<(), RedisError> {
  let pool = Builder::default_centralized().build_pool(5)?;
  let connection_task = pool.init().await?;

  // ...

  pool.quit().await?;
  connection_task.await?
}
source§

fn quit(&self) -> impl Future<Output = RedisResult<()>>

Close the connection to the Redis server for each client. The returned future resolves when the command has been written to the socket, not when the connection has been fully closed. Some time after this future resolves the future returned by connect will resolve which indicates that the connection has been fully closed.

This function will also close all error, pubsub message, and reconnection event streams on all clients in the pool.

source§

fn id(&self) -> &str

The unique ID identifying this client and underlying connections.
source§

fn client_config(&self) -> RedisConfig

Read the config used to initialize the client.
source§

fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>

Read the reconnect policy used to initialize the client.
source§

fn connection_config(&self) -> &ConnectionConfig

Read the connection config used to initialize the client.
source§

fn protocol_version(&self) -> RespVersion

Read the RESP version used by the client when communicating with the server.
source§

fn has_reconnect_policy(&self) -> bool

Whether the client has a reconnection policy.
source§

fn is_pipelined(&self) -> bool

Whether the client will automatically pipeline commands.
source§

fn is_clustered(&self) -> bool

Whether the client is connected to a cluster.
source§

fn uses_sentinels(&self) -> bool

Whether the client uses the sentinel interface.
source§

fn perf_config(&self) -> PerformanceConfig

Read the PerformanceConfig associated with this client.
source§

fn state(&self) -> ClientState

Read the state of the underlying connection(s). Read more
source§

fn is_connected(&self) -> bool

Whether all underlying connections are healthy.
source§

fn server_version(&self) -> Option<Version>

Read the server version, if known.
source§

fn shutdown( &self, flags: Option<ShutdownFlags>, ) -> impl Future<Output = RedisResult<()>>

Available on crate feature i-server only.
Shut down the server and quit the client. Read more
source§

fn flushall<R>(&self, async: bool) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Delete the keys in all databases. Read more
source§

fn flushall_cluster(&self) -> impl Future<Output = RedisResult<()>>

Delete the keys on all nodes in the cluster. This is a special function that does not map directly to the Redis interface.
source§

fn ping<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Ping the Redis server. Read more
source§

fn info<R>( &self, section: Option<InfoKind>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Read info about the server. Read more
source§

fn custom<R, T>( &self, cmd: CustomCommand, args: Vec<T>, ) -> impl Future<Output = RedisResult<R>>

Run a custom command that is not yet supported via another interface on this client. This is most useful when interacting with third party modules or extensions. Read more
source§

fn custom_raw<T>( &self, cmd: CustomCommand, args: Vec<T>, ) -> impl Future<Output = RedisResult<Resp3Frame>>

Run a custom command similar to custom, but return the response frame directly without any parsing. Read more
source§

fn with_options(&self, options: &Options) -> WithOptions<Self>

Customize various configuration options on commands.
source§

impl Clone for RedisPool

source§

fn clone(&self) -> RedisPool

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 ClusterInterface for RedisPool

Available on crate feature i-cluster only.
source§

fn cached_cluster_state(&self) -> Option<ClusterRouting>

Read the cached cluster state used for routing commands to the correct cluster nodes.
source§

fn num_primary_cluster_nodes(&self) -> usize

Read the number of known primary cluster nodes, or 0 if the cluster state is not known.
source§

fn sync_cluster(&self) -> impl Future<Output = Result<(), RedisError>>

Update the cached cluster state and add or remove any changed cluster node connections.
source§

fn cluster_bumpepoch<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Advances the cluster config epoch. Read more
source§

fn cluster_flushslots(&self) -> impl Future<Output = RedisResult<()>>

Deletes all slots from a node. Read more
source§

fn cluster_myid<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Returns the node’s id. Read more
source§

fn cluster_nodes<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Read the current cluster node configuration. Read more
source§

fn cluster_saveconfig(&self) -> impl Future<Output = RedisResult<()>>

Forces a node to save the nodes.conf configuration on disk. Read more
source§

fn cluster_slots<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

CLUSTER SLOTS returns details about which cluster slots map to which Redis instances. Read more
source§

fn cluster_info<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

CLUSTER INFO provides INFO style information about Redis Cluster vital parameters. Read more
source§

fn cluster_add_slots<S>( &self, slots: S, ) -> impl Future<Output = RedisResult<()>>

This command is useful in order to modify a node’s view of the cluster configuration. Specifically it assigns a set of hash slots to the node receiving the command. Read more
source§

fn cluster_count_failure_reports<R, S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

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

fn cluster_count_keys_in_slot<R>( &self, slot: u16, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn cluster_del_slots<S>( &self, slots: S, ) -> impl Future<Output = RedisResult<()>>

The CLUSTER DELSLOTS command asks a particular Redis Cluster node to forget which master is serving the hash slots specified as arguments. Read more
source§

fn cluster_failover( &self, flag: Option<ClusterFailoverFlag>, ) -> impl Future<Output = RedisResult<()>>

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_forget<S>(&self, node_id: S) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

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_get_keys_in_slot<R>( &self, slot: u16, count: u64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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_keyslot<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Returns an integer identifying the hash slot the specified key hashes to. Read more
source§

fn cluster_meet<S>( &self, ip: S, port: u16, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

CLUSTER MEET is used in order to connect different Redis nodes with cluster support enabled, into a working cluster. Read more
source§

fn cluster_replicate<S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

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_replicas<R, S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

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

fn cluster_reset( &self, mode: Option<ClusterResetFlag>, ) -> impl Future<Output = RedisResult<()>>

Reset a Redis Cluster node, in a more or less drastic way depending on the reset type, that can be hard or soft. Note that this command does not work for masters if they hold one or more keys, in that case to completely reset a master node keys must be removed first, e.g. by using FLUSHALL first, and then CLUSTER RESET. Read more
source§

fn cluster_set_config_epoch( &self, epoch: u64, ) -> impl Future<Output = RedisResult<()>>

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

fn cluster_setslot( &self, slot: u16, state: ClusterSetSlotState, ) -> impl Future<Output = RedisResult<()>>

CLUSTER SETSLOT is responsible for changing the state of a hash slot in the receiving node in different ways. Read more
source§

impl ConfigInterface for RedisPool

Available on crate feature i-config only.
source§

fn config_resetstat(&self) -> impl Future<Output = RedisResult<()>>

Resets the statistics reported by Redis using the INFO command. Read more
source§

fn config_rewrite(&self) -> impl Future<Output = RedisResult<()>>

The CONFIG REWRITE command 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_get<R, S>(&self, parameter: S) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

The CONFIG GET command is used to read the configuration parameters of a running Redis server. Read more
source§

fn config_set<P, V>( &self, parameter: P, value: V, ) -> impl Future<Output = RedisResult<()>>
where P: Into<Str>, V: TryInto<RedisValue>, V::Error: Into<RedisError>,

The CONFIG SET command is used in order to reconfigure the server at run time without the need to restart Redis. Read more
source§

impl Debug for RedisPool

source§

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

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

impl FunctionInterface for RedisPool

Available on crate feature i-scripts only.
source§

fn fcall<R, F, K, V>( &self, func: F, keys: K, args: V, ) -> impl Future<Output = RedisResult<R>>

Invoke a function. Read more
source§

fn fcall_ro<R, F, K, V>( &self, func: F, keys: K, args: V, ) -> impl Future<Output = RedisResult<R>>

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

fn function_delete<R, S>( &self, library_name: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

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

fn function_delete_cluster<S>( &self, library_name: S, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

Delete a library and all its functions from each cluster node concurrently. Read more
source§

fn function_dump<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the serialized payload of loaded libraries. Read more
source§

fn function_flush<R>(&self, async: bool) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Deletes all the libraries. Read more
source§

fn function_flush_cluster( &self, async: bool, ) -> impl Future<Output = RedisResult<()>>

Deletes all the libraries on all cluster nodes concurrently. Read more
source§

fn function_kill<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn function_list<R, S>( &self, library_name: Option<S>, withcode: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

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

fn function_load<R, S>( &self, replace: bool, code: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Load a library to Redis. Read more
source§

fn function_load_cluster<R, S>( &self, replace: bool, code: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Load a library to Redis on all cluster nodes concurrently. Read more
source§

fn function_restore<R, B, P>( &self, serialized: B, policy: P, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, B: Into<Bytes>, P: TryInto<FnPolicy>, P::Error: Into<RedisError>,

Restore libraries from the serialized payload. Read more
source§

fn function_restore_cluster<B, P>( &self, serialized: B, policy: P, ) -> impl Future<Output = RedisResult<()>>
where B: Into<Bytes>, P: TryInto<FnPolicy>, P::Error: Into<RedisError>,

Restore libraries from the serialized payload on all cluster nodes concurrently. Read more
source§

fn function_stats<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

impl GeoInterface for RedisPool

Available on crate feature i-geo only.
source§

fn geoadd<R, K, V>( &self, key: K, options: Option<SetOptions>, changed: bool, values: V, ) -> impl Future<Output = RedisResult<R>>

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

fn geohash<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

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

fn geopos<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

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 geodist<R, K, S, D>( &self, key: K, src: S, dest: D, unit: Option<GeoUnit>, ) -> impl Future<Output = RedisResult<R>>

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

fn georadius<R, K, P>( &self, key: K, position: P, radius: f64, unit: GeoUnit, withcoord: bool, withdist: bool, withhash: bool, count: Option<(u64, Any)>, ord: Option<SortOrder>, store: Option<RedisKey>, storedist: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<GeoPosition>,

Return the members of a sorted set populated with geospatial information using GEOADD, which are within the borders of the area specified with the center location and the maximum distance from the center (the radius). Read more
source§

fn georadiusbymember<R, K, V>( &self, key: K, member: V, radius: f64, unit: GeoUnit, withcoord: bool, withdist: bool, withhash: bool, count: Option<(u64, Any)>, ord: Option<SortOrder>, store: Option<RedisKey>, storedist: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>>

This command is exactly like GEORADIUS with the sole difference that instead of taking, as the center of the area to query, a longitude and latitude value, it takes the name of a member already existing inside the geospatial index represented by the sorted set. Read more
source§

fn geosearch<R, K>( &self, key: K, from_member: Option<RedisValue>, from_lonlat: Option<GeoPosition>, by_radius: Option<(f64, GeoUnit)>, by_box: Option<(f64, f64, GeoUnit)>, ord: Option<SortOrder>, count: Option<(u64, Any)>, withcoord: bool, withdist: bool, withhash: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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<R, D, S>( &self, dest: D, source: S, from_member: Option<RedisValue>, from_lonlat: Option<GeoPosition>, by_radius: Option<(f64, GeoUnit)>, by_box: Option<(f64, f64, GeoUnit)>, ord: Option<SortOrder>, count: Option<(u64, Any)>, storedist: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, D: Into<RedisKey>, S: Into<RedisKey>,

This command is like GEOSEARCH, but stores the result in destination key. Returns the number of members added to the destination key. Read more
source§

impl HashesInterface for RedisPool

Available on crate feature i-hashes only.
source§

fn hgetall<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn hdel<R, K, F>( &self, key: K, fields: F, ) -> impl Future<Output = RedisResult<R>>

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

fn hexists<R, K, F>( &self, key: K, field: F, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, F: Into<RedisKey>,

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

fn hget<R, K, F>( &self, key: K, field: F, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, F: Into<RedisKey>,

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

fn hincrby<R, K, F>( &self, key: K, field: F, increment: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, F: Into<RedisKey>,

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

fn hincrbyfloat<R, K, F>( &self, key: K, field: F, increment: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, F: Into<RedisKey>,

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

fn hkeys<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn hlen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn hmget<R, K, F>( &self, key: K, fields: F, ) -> impl Future<Output = RedisResult<R>>

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

fn hmset<R, K, V>( &self, key: K, values: V, ) -> impl Future<Output = RedisResult<R>>

Sets the specified fields to their respective values in the hash stored at key. Read more
source§

fn hset<R, K, V>( &self, key: K, values: V, ) -> impl Future<Output = RedisResult<R>>

Sets fields in the hash stored at key to their provided values. Read more
source§

fn hsetnx<R, K, F, V>( &self, key: K, field: F, value: V, ) -> impl Future<Output = RedisResult<R>>

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

fn hrandfield<R, K>( &self, key: K, count: Option<(i64, bool)>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

When called with just the key argument, return a random field from the hash value stored at key. Read more
source§

fn hstrlen<R, K, F>( &self, key: K, field: F, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, F: Into<RedisKey>,

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

fn hvals<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

impl HeartbeatInterface for RedisPool

source§

fn enable_heartbeat( &self, interval: Duration, break_on_error: bool, ) -> impl Future<Output = RedisResult<()>>

Return a future that will ping the server on an interval.
source§

impl HyperloglogInterface for RedisPool

Available on crate feature i-hyperloglog only.
source§

fn pfadd<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument. Read more
source§

fn pfcount<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist. Read more
source§

fn pfmerge<R, D, S>( &self, dest: D, sources: S, ) -> impl Future<Output = RedisResult<R>>

Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed sets of the source HyperLogLog structures. Read more
source§

impl KeysInterface for RedisPool

Available on crate feature i-keys only.
source§

fn watch<K>(&self, keys: K) -> impl Future<Output = RedisResult<()>>
where K: Into<MultipleKeys>,

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

fn unwatch(&self) -> impl Future<Output = RedisResult<()>>

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

fn randomkey<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn copy<R, S, D>( &self, source: S, destination: D, db: Option<u8>, replace: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

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

fn dump<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn restore<R, K>( &self, key: K, ttl: i64, serialized: RedisValue, replace: bool, absttl: bool, idletime: Option<i64>, frequency: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Create a key associated with a value that is obtained by deserializing the provided serialized value Read more
source§

fn set<R, K, V>( &self, key: K, value: V, expire: Option<Expiration>, options: Option<SetOptions>, get: bool, ) -> impl Future<Output = RedisResult<R>>

Set a value with optional NX|XX, EX|PX|EXAT|PXAT|KEEPTTL, and GET arguments. Read more
source§

fn get<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Read a value from the server. Read more
source§

fn getrange<R, K>( &self, key: K, start: usize, end: usize, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn setrange<R, K, V>( &self, key: K, offset: u32, value: V, ) -> impl Future<Output = RedisResult<R>>

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

fn getset<R, K, V>( &self, key: K, value: V, ) -> impl Future<Output = RedisResult<R>>

Atomically sets key to value and returns the old value stored at key. Read more
source§

fn getdel<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Get the value of key and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success (if and only if the key’s value type is a string). Read more
source§

fn strlen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Returns the length of the string value stored at key. An error is returned when key holds a non-string value. Read more
source§

fn del<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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

fn rename<R, S, D>( &self, source: S, destination: D, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Renames source key to destination. Read more
source§

fn renamenx<R, S, D>( &self, source: S, destination: D, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Renames source key to destination if destination does not yet exist. Read more
source§

fn append<R, K, V>( &self, key: K, value: V, ) -> impl Future<Output = RedisResult<R>>

Append value to key if it’s a string. Read more
source§

fn mget<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value nil is returned. Read more
source§

fn mset<V>(&self, values: V) -> impl Future<Output = RedisResult<()>>

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

fn msetnx<R, V>(&self, values: V) -> impl Future<Output = RedisResult<R>>

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 incr<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. Read more
source§

fn incr_by<R, K>( &self, key: K, val: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Increments the number stored at key by val. If the key does not exist, it is set to 0 before performing the operation. Read more
source§

fn incr_by_float<R, K>( &self, key: K, val: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Increment the string representing a floating point number stored at key by val. If the key does not exist, it is set to 0 before performing the operation. Read more
source§

fn decr<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Decrements the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. Read more
source§

fn decr_by<R, K>( &self, key: K, val: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Decrements the number stored at key by val. If the key does not exist, it is set to 0 before performing the operation. Read more
source§

fn ttl<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn pttl<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn persist<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn expire<R, K>( &self, key: K, seconds: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Set a timeout on key. After the timeout has expired, the key will be automatically deleted. Read more
source§

fn expire_at<R, K>( &self, key: K, timestamp: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Set a timeout on a key based on a UNIX timestamp. Read more
source§

fn pexpire<R, K>( &self, key: K, milliseconds: i64, options: Option<ExpireOptions>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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 pexpire_at<R, K>( &self, key: K, timestamp: i64, options: Option<ExpireOptions>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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 exists<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

Returns number of keys that exist from the keys arguments. Read more
source§

fn lcs<R, K1, K2>( &self, key1: K1, key2: K2, len: bool, idx: bool, minmatchlen: Option<i64>, withmatchlen: bool, ) -> impl Future<Output = Result<R, RedisError>>
where R: FromRedis, K1: Into<RedisKey>, K2: Into<RedisKey>,

Runs the longest common subsequence algorithm on two keys. Read more
source§

impl ListInterface for RedisPool

Available on crate feature i-lists only.
source§

fn blmpop<R, K>( &self, timeout: f64, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

The blocking variant of Self::lmpop. Read more
source§

fn blpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given. Read more
source§

fn brpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given. Read more
source§

fn brpoplpush<R, S, D>( &self, source: S, destination: D, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

The blocking equivalent of Self::rpoplpush. Read more
source§

fn blmove<R, S, D>( &self, source: S, destination: D, source_direction: LMoveDirection, destination_direction: LMoveDirection, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

The blocking equivalent of Self::lmove. Read more
source§

fn lmpop<R, K>( &self, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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

fn lindex<R, K>( &self, key: K, index: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn linsert<R, K, P, V>( &self, key: K, location: ListLocation, pivot: P, element: V, ) -> impl Future<Output = RedisResult<R>>

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

fn llen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn lpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn lpos<R, K, V>( &self, key: K, element: V, rank: Option<i64>, count: Option<i64>, maxlen: Option<i64>, ) -> impl Future<Output = RedisResult<R>>

The command returns the index of matching elements inside a Redis list. Read more
source§

fn lpush<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

fn lpushx<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

fn lrange<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn lrem<R, K, V>( &self, key: K, count: i64, element: V, ) -> impl Future<Output = RedisResult<R>>

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

fn lset<R, K, V>( &self, key: K, index: i64, element: V, ) -> impl Future<Output = RedisResult<R>>

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

fn ltrim<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn rpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn rpoplpush<R, S, D>( &self, source: S, dest: D, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination. Read more
source§

fn lmove<R, S, D>( &self, source: S, dest: D, source_direction: LMoveDirection, dest_direction: LMoveDirection, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

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

fn rpush<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

fn rpushx<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

fn sort<R, K, S>( &self, key: K, by: Option<Str>, limit: Option<Limit>, get: S, order: Option<SortOrder>, alpha: bool, store: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>>

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

fn sort_ro<R, K, S>( &self, key: K, by: Option<Str>, limit: Option<Limit>, get: S, order: Option<SortOrder>, alpha: bool, ) -> impl Future<Output = RedisResult<R>>

Read-only variant of the SORT command. It is exactly like the original SORT but refuses the STORE option and can safely be used in read-only replicas. Read more
source§

impl LuaInterface for RedisPool

Available on crate feature i-scripts only.
source§

fn script_load<R, S>(&self, script: S) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Load a script into the scripts cache, without executing it. After the specified command is loaded into the script cache it will be callable using EVALSHA with the correct SHA1 digest of the script. Read more
source§

fn script_load_cluster<R, S>( &self, script: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Available on crate feature sha-1 only.
A clustered variant of script_load that loads the script on all primary nodes in a cluster. Read more
source§

fn script_kill(&self) -> impl Future<Output = RedisResult<()>>

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

fn script_kill_cluster(&self) -> impl Future<Output = RedisResult<()>>

A clustered variant of the script_kill command that issues the command to all primary nodes in the cluster.
source§

fn script_flush(&self, async: bool) -> impl Future<Output = RedisResult<()>>

Flush the Lua scripts cache. Read more
source§

fn script_flush_cluster( &self, async: bool, ) -> impl Future<Output = RedisResult<()>>

A clustered variant of script_flush that flushes the script cache on all primary nodes in the cluster.
source§

fn script_exists<R, H>(&self, hashes: H) -> impl Future<Output = RedisResult<R>>

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

fn script_debug( &self, flag: ScriptDebugFlag, ) -> impl Future<Output = RedisResult<()>>

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

fn evalsha<R, S, K, V>( &self, hash: S, keys: K, args: V, ) -> impl Future<Output = RedisResult<R>>

Evaluates a script cached on the server side by its SHA1 digest. Read more
source§

fn eval<R, S, K, V>( &self, script: S, keys: K, args: V, ) -> impl Future<Output = RedisResult<R>>

Evaluate a Lua script on the server. Read more
source§

impl MemoryInterface for RedisPool

Available on crate feature i-memory only.
source§

fn memory_doctor<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

The MEMORY DOCTOR command reports about different memory-related issues that the Redis server experiences, and advises about possible remedies. Read more
source§

fn memory_malloc_stats<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

The MEMORY MALLOC-STATS command provides an internal statistics report from the memory allocator. Read more
source§

fn memory_purge(&self) -> impl Future<Output = RedisResult<()>>

The MEMORY PURGE command attempts to purge dirty pages so these can be reclaimed by the allocator. Read more
source§

fn memory_stats<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

The MEMORY STATS command returns an Array reply about the memory usage of the server. Read more
source§

fn memory_usage<R, K>( &self, key: K, samples: Option<u32>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM. Read more
source§

impl RediSearchInterface for RedisPool

Available on crate feature i-redisearch only.
source§

fn ft_list<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn ft_aggregate<R, I, Q>( &self, index: I, query: Q, options: FtAggregateOptions, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, Q: Into<Str>,

Run a search query on an index, and perform aggregate transformations on the results. Read more
Search the index with a textual query, returning either documents or just ids. Read more
source§

fn ft_create<R, I>( &self, index: I, options: FtCreateOptions, schema: Vec<SearchSchema>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>,

Create an index with the given specification. Read more
source§

fn ft_alter<R, I>( &self, index: I, options: FtAlterOptions, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>,

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

fn ft_aliasadd<R, A, I>( &self, alias: A, index: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, A: Into<Str>, I: Into<Str>,

Add an alias to an index. Read more
source§

fn ft_aliasdel<R, A>(&self, alias: A) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, A: Into<Str>,

Remove an alias from an index. Read more
source§

fn ft_aliasupdate<R, A, I>( &self, alias: A, index: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, A: Into<Str>, I: Into<Str>,

Add an alias to an index. If the alias is already associated with another index, FT.ALIASUPDATE removes the alias association with the previous index. Read more
source§

fn ft_config_get<R, S>(&self, option: S) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

Retrieve configuration options. Read more
source§

fn ft_config_set<R, S, V>( &self, option: S, value: V, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>, V: TryInto<RedisValue>, V::Error: Into<RedisError>,

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

fn ft_cursor_del<R, I, C>( &self, index: I, cursor: C, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, C: TryInto<RedisValue>, C::Error: Into<RedisError>,

Delete a cursor. Read more
source§

fn ft_cursor_read<R, I, C>( &self, index: I, cursor: C, count: Option<u64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, C: TryInto<RedisValue>, C::Error: Into<RedisError>,

Read next results from an existing cursor. Read more
source§

fn ft_dictadd<R, D, S>( &self, dict: D, terms: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, D: Into<Str>, S: Into<MultipleStrings>,

Add terms to a dictionary. Read more
source§

fn ft_dictdel<R, D, S>( &self, dict: D, terms: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, D: Into<Str>, S: Into<MultipleStrings>,

Remove terms from a dictionary. Read more
source§

fn ft_dictdump<R, D>(&self, dict: D) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, D: Into<Str>,

Dump all terms in the given dictionary. Read more
source§

fn ft_dropindex<R, I>( &self, index: I, dd: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>,

Delete an index. Read more
source§

fn ft_explain<R, I, Q>( &self, index: I, query: Q, dialect: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, Q: Into<Str>,

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

fn ft_info<R, I>(&self, index: I) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>,

Return information and statistics on the index. Read more
source§

fn ft_spellcheck<R, I, Q>( &self, index: I, query: Q, distance: Option<u8>, terms: Option<SpellcheckTerms>, dialect: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, Q: Into<Str>,

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

fn ft_sugadd<R, K, S>( &self, key: K, string: S, score: f64, incr: bool, payload: Option<Bytes>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, S: Into<Str>,

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

fn ft_sugdel<R, K, S>( &self, key: K, string: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, S: Into<Str>,

Delete a string from a suggestion index. Read more
source§

fn ft_sugget<R, K, P>( &self, key: K, prefix: P, fuzzy: bool, withscores: bool, withpayloads: bool, max: Option<u64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

Get completion suggestions for a prefix. Read more
source§

fn ft_suglen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn ft_syndump<R, I>(&self, index: I) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>,

Dump the contents of a synonym group. Read more
source§

fn ft_synupdate<R, I, S, T>( &self, index: I, synonym_group_id: S, skipinitialscan: bool, terms: T, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, S: Into<Str>, T: Into<MultipleStrings>,

Update a synonym group. Read more
source§

fn ft_tagvals<R, I, F>( &self, index: I, field_name: F, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, I: Into<Str>, F: Into<Str>,

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

impl RedisJsonInterface for RedisPool

Available on crate feature i-redis-json only.
source§

fn json_arrappend<R, K, P, V>( &self, key: K, path: P, values: Vec<V>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_arrindex<R, K, P, V>( &self, key: K, path: P, value: V, start: Option<i64>, stop: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

Search for the first occurrence of a JSON value in an array. Read more
source§

fn json_arrinsert<R, K, P, V>( &self, key: K, path: P, index: i64, values: Vec<V>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_arrlen<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_arrpop<R, K, P>( &self, key: K, path: Option<P>, index: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_arrtrim<R, K, P>( &self, key: K, path: P, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

Trim an array so that it contains only the specified inclusive range of elements Read more
source§

fn json_clear<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_debug_memory<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_del<R, K, P>( &self, key: K, path: P, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

Delete a value. Read more
source§

fn json_get<R, K, I, N, S, P>( &self, key: K, indent: Option<I>, newline: Option<N>, space: Option<S>, paths: P, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, I: Into<Str>, N: Into<Str>, S: Into<Str>, P: Into<MultipleStrings>,

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

fn json_merge<R, K, P, V>( &self, key: K, path: P, value: V, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_mget<R, K, P>( &self, keys: K, path: P, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>, P: Into<Str>,

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

fn json_mset<R, K, P, V>( &self, values: Vec<(K, P, V)>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_numincrby<R, K, P, V>( &self, key: K, path: P, value: V, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_objkeys<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_objlen<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_resp<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

Return the JSON in key in Redis serialization protocol specification form. Read more
source§

fn json_set<R, K, P, V>( &self, key: K, path: P, value: V, options: Option<SetOptions>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_strappend<R, K, P, V>( &self, key: K, path: Option<P>, value: V, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>, V: Into<Value>,

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

fn json_strlen<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

fn json_toggle<R, K, P>( &self, key: K, path: P, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

Toggle a Boolean value stored at path. Read more
source§

fn json_type<R, K, P>( &self, key: K, path: Option<P>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, P: Into<Str>,

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

impl ServerInterface for RedisPool

Available on crate feature i-server only.
source§

fn bgrewriteaof<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Instruct Redis to start an Append Only File rewrite process. Read more
source§

fn bgsave<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Save the DB in background. Read more
source§

fn dbsize<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the number of keys in the selected database. Read more
source§

fn select(&self, db: u8) -> impl Future<Output = RedisResult<()>>

Select the database this client should use. Read more
source§

fn failover( &self, to: Option<(String, u16)>, force: bool, abort: bool, timeout: Option<u32>, ) -> impl Future<Output = RedisResult<()>>

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

fn lastsave<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

fn wait<R>( &self, numreplicas: i64, timeout: i64, ) -> impl Future<Output = Result<R, RedisError>>
where R: FromRedis,

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. If the timeout, specified in milliseconds, is reached, the command returns even if the specified number of replicas were not yet reached. Read more
source§

fn sentinel_primary(&self) -> Option<Server>

Read the primary Redis server identifier returned from the sentinel nodes.
source§

fn sentinel_nodes(&self) -> Option<Vec<Server>>

Read the set of known sentinel nodes.
source§

impl SetsInterface for RedisPool

Available on crate feature i-sets only.
source§

fn sadd<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

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

fn scard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn sdiff<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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

fn sdiffstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>

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

fn sinter<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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

fn sinterstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>

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

fn sismember<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>

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

fn smismember<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

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

fn smembers<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn smove<R, S, D, V>( &self, source: S, dest: D, member: V, ) -> impl Future<Output = RedisResult<R>>

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

fn spop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn srandmember<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

When called with just the key argument, return a random element from the set value stored at key. Read more
source§

fn srem<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

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

fn sunion<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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

fn sunionstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>

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

impl SlowlogInterface for RedisPool

Available on crate feature i-slowlog only.
source§

fn slowlog_get<R>( &self, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

This command is used to read the slow queries log. Read more
source§

fn slowlog_length<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

This command is used to read length of the slow queries log. Read more
source§

fn slowlog_reset(&self) -> impl Future<Output = RedisResult<()>>

This command is used to reset the slow queries log. Read more
source§

impl SortedSetsInterface for RedisPool

Available on crate feature i-sorted-sets only.
source§

fn bzmpop<R, K>( &self, timeout: f64, keys: K, sort: ZCmp, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

The blocking variant of Self::zmpop. Read more
source§

fn bzpopmin<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

The blocking variant of Self::zpopmin. Read more
source§

fn bzpopmax<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

The blocking variant of Self::zpopmax. Read more
source§

fn zadd<R, K, V>( &self, key: K, options: Option<SetOptions>, ordering: Option<Ordering>, changed: bool, incr: bool, values: V, ) -> impl Future<Output = RedisResult<R>>

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

fn zcard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn zcount<R, K>( &self, key: K, min: f64, max: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn zdiff<R, K>( &self, keys: K, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>

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

fn zincrby<R, K, V>( &self, key: K, increment: f64, member: V, ) -> impl Future<Output = RedisResult<R>>

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

fn zinter<R, K, W>( &self, keys: K, weights: W, aggregate: Option<AggregateOptions>, withscores: bool, ) -> impl Future<Output = RedisResult<R>>

This command is similar to ZINTERSTORE, but instead of storing the resulting sorted set, it is returned to the client. Read more
source§

fn zinterstore<R, D, K, W>( &self, dest: D, keys: K, weights: W, aggregate: Option<AggregateOptions>, ) -> impl Future<Output = RedisResult<R>>

Computes the intersection of the sorted sets given by the specified keys, and stores the result in destination. Read more
source§

fn zlexcount<R, K, M, N>( &self, key: K, min: M, max: N, ) -> impl Future<Output = RedisResult<R>>

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 zpopmax<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn zpopmin<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn zmpop<R, K>( &self, keys: K, sort: ZCmp, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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 zrandmember<R, K>( &self, key: K, count: Option<(i64, bool)>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

When called with just the key argument, return a random element from the sorted set value stored at key. Read more
source§

fn zrangestore<R, D, S, M, N>( &self, dest: D, source: S, min: M, max: N, sort: Option<ZSort>, rev: bool, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>

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

fn zrange<R, K, M, N>( &self, key: K, min: M, max: N, sort: Option<ZSort>, rev: bool, limit: Option<Limit>, withscores: bool, ) -> impl Future<Output = RedisResult<R>>

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

fn zrangebylex<R, K, M, N>( &self, key: K, min: M, max: N, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max. Read more
source§

fn zrevrangebylex<R, K, M, N>( &self, key: K, max: M, min: N, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between max and min. Read more
source§

fn zrangebyscore<R, K, M, N>( &self, key: K, min: M, max: N, withscores: bool, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>

Returns all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max). Read more
source§

fn zrevrangebyscore<R, K, M, N>( &self, key: K, max: M, min: N, withscores: bool, limit: Option<Limit>, ) -> impl Future<Output = RedisResult<R>>

Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min). Read more
source§

fn zrank<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>

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<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

Removes the specified members from the sorted set stored at key. Non existing members are ignored. Read more
source§

fn zremrangebylex<R, K, M, N>( &self, key: K, min: M, max: N, ) -> impl Future<Output = RedisResult<R>>

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<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn zremrangebyscore<R, K, M, N>( &self, key: K, min: M, max: N, ) -> impl Future<Output = RedisResult<R>>

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

fn zrevrange<R, K>( &self, key: K, start: i64, stop: i64, withscores: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn zrevrank<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>

Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. Read more
source§

fn zscore<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>

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

fn zunion<R, K, W>( &self, keys: K, weights: W, aggregate: Option<AggregateOptions>, withscores: bool, ) -> impl Future<Output = RedisResult<R>>

This command is similar to ZUNIONSTORE, but instead of storing the resulting sorted set, it is returned to the client. Read more
source§

fn zunionstore<R, D, K, W>( &self, dest: D, keys: K, weights: W, aggregate: Option<AggregateOptions>, ) -> impl Future<Output = RedisResult<R>>

Computes the union of the sorted sets given by the specified keys, and stores the result in destination. Read more
source§

fn zmscore<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>

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

impl StreamsInterface for RedisPool

Available on crate feature i-streams only.
source§

fn xinfo_consumers<R, K, S>( &self, key: K, groupname: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, S: Into<Str>,

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<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

This command returns the list of all consumers groups of the stream stored at key. Read more
source§

fn xinfo_stream<R, K>( &self, key: K, full: bool, count: Option<u64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn xadd<R, K, C, I, F>( &self, key: K, nomkstream: bool, cap: C, id: I, fields: F, ) -> impl Future<Output = RedisResult<R>>

Appends the specified stream entry to the stream at the specified key. If the key does not exist, as a side effect of running this command the key is created with a stream value. The creation of stream’s key can be disabled with the NOMKSTREAM option. Read more
source§

fn xtrim<R, K, C>(&self, key: K, cap: C) -> impl Future<Output = RedisResult<R>>

Trims the stream by evicting older entries (entries with lower IDs) if needed. Read more
source§

fn xdel<R, K, S>(&self, key: K, ids: S) -> impl Future<Output = RedisResult<R>>

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

fn xrange_values<Ri, Rk, Rv, K, S, E>( &self, key: K, start: S, end: E, count: Option<u64>, ) -> impl Future<Output = RedisResult<Vec<XReadValue<Ri, Rk, Rv>>>>

Return the stream entries matching the provided range of IDs, automatically converting to a less verbose type definition. Read more
source§

fn xrange<R, K, S, E>( &self, key: K, start: S, end: E, count: Option<u64>, ) -> impl Future<Output = RedisResult<R>>

The command returns the stream entries matching a given range of IDs. The range is specified by a minimum and maximum ID. All the entries having an ID between the two specified or exactly one of the two IDs specified (closed interval) are returned. Read more
source§

fn xrevrange_values<Ri, Rk, Rv, K, E, S>( &self, key: K, end: E, start: S, count: Option<u64>, ) -> impl Future<Output = RedisResult<Vec<XReadValue<Ri, Rk, Rv>>>>

Similar to XRANGE, but with the results returned in reverse order. The results will be automatically converted to a less verbose type definition. Read more
source§

fn xrevrange<R, K, S, E>( &self, key: K, end: E, start: S, count: Option<u64>, ) -> impl Future<Output = RedisResult<R>>

Similar to XRANGE, but with the results returned in reverse order. Read more
source§

fn xlen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn xread_map<Rk1, Rk2, Rk3, Rv, K, I>( &self, count: Option<u64>, block: Option<u64>, keys: K, ids: I, ) -> impl Future<Output = RedisResult<XReadResponse<Rk1, Rk2, Rk3, Rv>>>
where Rk1: FromRedisKey + Hash + Eq, Rk2: FromRedis, Rk3: FromRedisKey + Hash + Eq, Rv: FromRedis, K: Into<MultipleKeys>, I: Into<MultipleIDs>,

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 xread<R, K, I>( &self, count: Option<u64>, block: Option<u64>, keys: K, ids: I, ) -> impl Future<Output = RedisResult<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 xgroup_create<R, K, S, I>( &self, key: K, groupname: S, id: I, mkstream: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, S: Into<Str>, I: Into<XID>,

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

fn xgroup_createconsumer<R, K, G, C>( &self, key: K, groupname: G, consumername: C, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, G: Into<Str>, C: Into<Str>,

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

fn xgroup_delconsumer<R, K, G, C>( &self, key: K, groupname: G, consumername: C, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, G: Into<Str>, C: Into<Str>,

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

fn xgroup_destroy<R, K, S>( &self, key: K, groupname: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, S: Into<Str>,

Completely destroy a consumer group. Read more
source§

fn xgroup_setid<R, K, S, I>( &self, key: K, groupname: S, id: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, S: Into<Str>, I: Into<XID>,

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

fn xreadgroup_map<Rk1, Rk2, Rk3, Rv, G, C, K, I>( &self, group: G, consumer: C, count: Option<u64>, block: Option<u64>, noack: bool, keys: K, ids: I, ) -> impl Future<Output = RedisResult<XReadResponse<Rk1, Rk2, Rk3, Rv>>>
where Rk1: FromRedisKey + Hash + Eq, Rk2: FromRedis, Rk3: FromRedisKey + Hash + Eq, Rv: FromRedis, G: Into<Str>, C: Into<Str>, K: Into<MultipleKeys>, I: Into<MultipleIDs>,

A special version of the XREAD command with support for consumer groups. Read more
source§

fn xreadgroup<R, G, C, K, I>( &self, group: G, consumer: C, count: Option<u64>, block: Option<u64>, noack: bool, keys: K, ids: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, G: Into<Str>, C: Into<Str>, K: Into<MultipleKeys>, I: Into<MultipleIDs>,

A special version of the XREAD command with support for consumer groups. Read more
source§

fn xack<R, K, G, I>( &self, key: K, group: G, ids: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, G: Into<Str>, I: Into<MultipleIDs>,

Remove one or more messages from the Pending Entries List (PEL) of a stream consumer group. Read more
source§

fn xclaim_values<Ri, Rk, Rv, K, G, C, I>( &self, key: K, group: G, consumer: C, min_idle_time: u64, ids: I, idle: Option<u64>, time: Option<u64>, retry_count: Option<u64>, force: bool, justid: bool, ) -> impl Future<Output = RedisResult<Vec<XReadValue<Ri, Rk, Rv>>>>
where Ri: FromRedis, Rk: FromRedisKey + Hash + Eq, Rv: FromRedis, K: Into<RedisKey>, G: Into<Str>, C: Into<Str>, I: Into<MultipleIDs>,

A variation of xclaim with a less verbose return type.
source§

fn xclaim<R, K, G, C, I>( &self, key: K, group: G, consumer: C, min_idle_time: u64, ids: I, idle: Option<u64>, time: Option<u64>, retry_count: Option<u64>, force: bool, justid: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, G: Into<Str>, C: Into<Str>, I: Into<MultipleIDs>,

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 xautoclaim_values<Ri, Rk, Rv, K, G, C, I>( &self, key: K, group: G, consumer: C, min_idle_time: u64, start: I, count: Option<u64>, justid: bool, ) -> impl Future<Output = RedisResult<(String, Vec<XReadValue<Ri, Rk, Rv>>)>>
where Ri: FromRedis, Rk: FromRedisKey + Hash + Eq, Rv: FromRedis, K: Into<RedisKey>, G: Into<Str>, C: Into<Str>, I: Into<XID>,

This command transfers ownership of pending stream entries that match the specified criteria. It also converts the response type to a less verbose type declaration and handles potential differences between RESP2 and RESP3. Read more
source§

fn xautoclaim<R, K, G, C, I>( &self, key: K, group: G, consumer: C, min_idle_time: u64, start: I, count: Option<u64>, justid: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, G: Into<Str>, C: Into<Str>, I: Into<XID>,

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

fn xpending<R, K, G, A>( &self, key: K, group: G, args: A, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, G: Into<Str>, A: Into<XPendingArgs>,

Inspect the list of pending messages in a consumer group. Read more
source§

impl TimeSeriesInterface for RedisPool

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

fn ts_add<R, K, T, L>( &self, key: K, timestamp: T, value: f64, retention: Option<u64>, encoding: Option<Encoding>, chunk_size: Option<u64>, on_duplicate: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Append a sample to a time series. Read more
source§

fn ts_alter<R, K, L>( &self, key: K, retention: Option<u64>, chunk_size: Option<u64>, duplicate_policy: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>>

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

fn ts_create<R, K, L>( &self, key: K, retention: Option<u64>, encoding: Option<Encoding>, chunk_size: Option<u64>, duplicate_policy: Option<DuplicatePolicy>, labels: L, ) -> impl Future<Output = RedisResult<R>>

Create a new time series. Read more
source§

fn ts_createrule<R, S, D>( &self, src: S, dest: D, aggregation: (Aggregator, u64), align_timestamp: Option<u64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Create a compaction rule. Read more
source§

fn ts_decrby<R, K, L>( &self, key: K, subtrahend: f64, timestamp: Option<Timestamp>, retention: Option<u64>, uncompressed: bool, chunk_size: Option<u64>, labels: L, ) -> impl Future<Output = RedisResult<R>>

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<R, K>( &self, key: K, from: i64, to: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn ts_deleterule<R, S, D>( &self, src: S, dest: D, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Delete a compaction rule. Read more
source§

fn ts_get<R, K>( &self, key: K, latest: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Get the sample with the highest timestamp from a given time series. Read more
source§

fn ts_incrby<R, K, L>( &self, key: K, addend: f64, timestamp: Option<Timestamp>, retention: Option<u64>, uncompressed: bool, chunk_size: Option<u64>, labels: L, ) -> impl Future<Output = RedisResult<R>>

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<R, K>( &self, key: K, debug: bool, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

fn ts_madd<R, K, I>(&self, samples: I) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>, I: IntoIterator<Item = (K, Timestamp, f64)>,

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

fn ts_mget<R, L, S, I>( &self, latest: bool, labels: Option<L>, filters: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, L: Into<GetLabels>, S: Into<Str>, I: IntoIterator<Item = S>,

Get the sample with the highest timestamp from each time series matching a specific filter. Read more
source§

fn ts_mrange<R, F, T, I, S, J>( &self, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, labels: Option<GetLabels>, count: Option<u64>, aggregation: Option<RangeAggregation>, filters: J, group_by: Option<GroupBy>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, S: Into<Str>, I: IntoIterator<Item = i64>, J: IntoIterator<Item = S>,

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

fn ts_mrevrange<R, F, T, I, S, J>( &self, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, labels: Option<GetLabels>, count: Option<u64>, aggregation: Option<RangeAggregation>, filters: J, group_by: Option<GroupBy>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, F: TryInto<GetTimestamp>, F::Error: Into<RedisError>, T: TryInto<GetTimestamp>, T::Error: Into<RedisError>, S: Into<Str>, I: IntoIterator<Item = i64>, J: IntoIterator<Item = S>,

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

fn ts_queryindex<R, S, I>( &self, filters: I, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>, I: IntoIterator<Item = S>,

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

fn ts_range<R, K, F, T, I>( &self, key: K, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, count: Option<u64>, aggregation: Option<RangeAggregation>, ) -> impl Future<Output = RedisResult<R>>

Query a range in forward direction. Read more
source§

fn ts_revrange<R, K, F, T, I>( &self, key: K, from: F, to: T, latest: bool, filter_by_ts: I, filter_by_value: Option<(i64, i64)>, count: Option<u64>, aggregation: Option<RangeAggregation>, ) -> impl Future<Output = RedisResult<R>>

Query a range in reverse direction. Read more
source§

impl TransactionInterface for RedisPool

Available on crate feature transactions only.
source§

fn multi(&self) -> Transaction

Enter a MULTI block, executing subsequent commands as a transaction. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T> Instrument for T

source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

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

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

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

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

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

source§

type Error = Infallible

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

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

Performs the conversion.
source§

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

source§

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

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

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

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
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