[−][src]Struct fred::client::RedisClient
A Redis client struct.
See the documentation for the Borrowed
and Owned
traits for how to execute commands against the server. Depending on your use case it may be beneficial to use different interfaces for
different use cases, and this library supports both an owned interface and a borrowed interface via different traits. Both traits implement the same high level interface, but provide
flexibility for use cases where taking ownership over the client may be limited vs use cases where owning the client instance may be preferred.
Methods
impl RedisClient
[src]
pub fn new(config: RedisConfig, timer: Option<Timer>) -> RedisClient
[src]
Create a new RedisClient
instance without connecting.
pub fn read_redelivery_count(&self) -> usize
[src]
Read the number of request redeliveries.
This is the number of times a request had to be sent again due to a connection closing while waiting on a response.
pub fn take_redelivery_count(&self) -> usize
[src]
Read and reset the number of request redeliveries.
pub fn state(&self) -> ClientState
[src]
Read the state of the underlying connection.
pub fn read_latency_metrics(&self) -> DistributionStats
[src]
Read latency metrics across all commands.
pub fn take_latency_metrics(&self) -> DistributionStats
[src]
Read and consume latency metrics, resetting their values afterwards.
pub fn read_req_size_metrics(&self) -> DistributionStats
[src]
Read request payload size metrics across all commands.
pub fn take_req_size_metrics(&self) -> DistributionStats
[src]
Read and consume request payload size metrics, resetting their values afterwards.
pub fn read_res_size_metrics(&self) -> DistributionStats
[src]
Read response payload size metrics across all commands.
pub fn take_res_size_metrics(&self) -> DistributionStats
[src]
Read and consume response payload size metrics, resetting their values afterwards.
pub fn command_queue_len(&self) -> usize
[src]
Read the number of buffered commands waiting to be sent to the server.
pub fn connect(&self, handle: &Handle) -> ConnectionFuture
[src]
Connect to the Redis server. The returned future will resolve when the connection to the Redis server has been fully closed by both ends.
The on_connect
function can be used to be notified when the client first successfully connects.
pub fn connect_with_policy(
&self,
handle: &Handle,
policy: ReconnectPolicy
) -> ConnectionFuture
[src]
&self,
handle: &Handle,
policy: ReconnectPolicy
) -> ConnectionFuture
Connect to the Redis server with a ReconnectPolicy
to apply if the connection closes due to an error.
The returned future will resolve when max_attempts
is reached on the ReconnectPolicy
.
Use the on_error
and on_reconnect
functions to be notified when the connection dies or successfully reconnects.
Note that when the client automatically reconnects it will not re-select the previously selected database,
nor will it re-subscribe to any pubsub channels. Use on_reconnect
to implement that functionality if needed.
Additionally, on_connect
can be used to be notified when the client first successfully connects, since sometimes
some special initialization is needed upon first connecting.
pub fn on_reconnect(&self) -> Box<dyn Stream<Item = Self, Error = RedisError>>
[src]
Listen for successful reconnection notifications. When using a config with a ReconnectPolicy
the future
returned by connect_with_policy
will not resolve until max_attempts
is reached, potentially running forever
if set to 0. This function can be used to receive notifications whenever the client successfully reconnects
in order to select the right database again, re-subscribe to channels, etc. A reconnection event is also
triggered upon first connecting.
pub fn on_connect(&self) -> Box<dyn Future<Item = Self, Error = RedisError>>
[src]
Returns a future that resolves when the client connects to the server. If the client is already connected this future will resolve immediately.
This can be used with on_reconnect
to separate initialization logic that needs
to occur only on the first connection vs subsequent connections.
pub fn on_error(&self) -> Box<dyn Stream<Item = RedisError, Error = RedisError>>
[src]
Listen for protocol and connection errors. This stream can be used to more intelligently handle errors that may not appear in the request-response cycle, and so cannot be handled by response futures.
Similar to on_message
, this function does not need to be called again if the connection goes down.
pub fn on_message(
&self
) -> Box<dyn Stream<Item = (String, RedisValue), Error = RedisError>>
[src]
&self
) -> Box<dyn Stream<Item = (String, RedisValue), Error = RedisError>>
Listen for (channel, message)
tuples on the PubSub interface.
If the connection to the Redis server goes down for any reason this function does not need to be called again.
Messages will start appearing on the original stream after subscribe
is called again.
pub fn is_clustered(&self) -> bool
[src]
Whether or not the client is using a clustered Redis deployment.
pub fn split_cluster(
&self,
handle: &Handle
) -> Box<dyn Future<Item = Vec<(RedisClient, RedisConfig)>, Error = RedisError>>
[src]
&self,
handle: &Handle
) -> Box<dyn Future<Item = Vec<(RedisClient, RedisConfig)>, Error = RedisError>>
Split a clustered redis client into a list of centralized clients for each master node in the cluster.
This is an expensive operation and should not be used frequently.
pub fn scan<P: Into<String>>(
&self,
pattern: Option<P>,
count: Option<usize>,
_type: Option<ScanType>
) -> Box<dyn Stream<Item = ScanResult, Error = RedisError>>
[src]
&self,
pattern: Option<P>,
count: Option<usize>,
_type: Option<ScanType>
) -> Box<dyn Stream<Item = ScanResult, Error = RedisError>>
Scan the redis database for keys matching the given pattern, if any. The scan operation can be canceled by dropping the returned stream.
pub fn hscan<K: Into<RedisKey>, P: Into<String>>(
&self,
key: K,
pattern: Option<P>,
count: Option<usize>
) -> Box<dyn Stream<Item = HScanResult, Error = RedisError>>
[src]
&self,
key: K,
pattern: Option<P>,
count: Option<usize>
) -> Box<dyn Stream<Item = HScanResult, Error = RedisError>>
Scan the redis database for keys within the given hash key, if any. The scan operation can be canceled by dropping the returned stream.
pub fn sscan<K: Into<RedisKey>, P: Into<String>>(
&self,
key: K,
pattern: Option<P>,
count: Option<usize>
) -> Box<dyn Stream<Item = SScanResult, Error = RedisError>>
[src]
&self,
key: K,
pattern: Option<P>,
count: Option<usize>
) -> Box<dyn Stream<Item = SScanResult, Error = RedisError>>
Scan the redis database for keys within the given set key, if any. The scan operation can be canceled by dropping the returned stream.
pub fn zscan<K: Into<RedisKey>, P: Into<String>>(
&self,
key: K,
pattern: Option<P>,
count: Option<usize>
) -> Box<dyn Stream<Item = ZScanResult, Error = RedisError>>
[src]
&self,
key: K,
pattern: Option<P>,
count: Option<usize>
) -> Box<dyn Stream<Item = ZScanResult, Error = RedisError>>
Scan the redis database for keys within the given sorted set key, if any. The scan operation can be canceled by dropping the returned stream.
Trait Implementations
impl RedisClientBorrowed for RedisClient
[src]
fn quit(&self) -> Box<dyn Future<Item = (), Error = RedisError>>
[src]
Close the connection to the Redis server. 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
or connect_with_policy
will resolve, and that indicates that the connection has been fully closed.
This function will also close all error, message, and reconnection event streams.
Note: This function will immediately succeed if the client is already disconnected. This is to allow quit
to be used
a means to break out from reconnect logic. If this function is called while the client is waiting to attempt to reconnect
then when it next wakes up to try to reconnect it will instead break out with a RedisErrorKind::Canceled
error.
This in turn will resolve the future returned by connect
or connect_with_policy
some time later.
fn flushall(
&self,
_async: bool
) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
&self,
_async: bool
) -> Box<dyn Future<Item = String, Error = RedisError>>
Delete the keys in all databases. Returns a string reply.
fn set<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
value: V,
expire: Option<Expiration>,
options: Option<SetOptions>
) -> Box<dyn Future<Item = bool, Error = RedisError>>
[src]
&self,
key: K,
value: V,
expire: Option<Expiration>,
options: Option<SetOptions>
) -> Box<dyn Future<Item = bool, Error = RedisError>>
Set a value at key
with optional NX|XX and EX|PX arguments.
The bool
returned by this function describes whether or not the key was set due to any NX|XX options.
fn get<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
Read a value from Redis at key
.
fn select(&self, db: u8) -> Box<dyn Future<Item = (), Error = RedisError>>
[src]
Select the database this client should use.
fn info(
&self,
section: Option<InfoKind>
) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
&self,
section: Option<InfoKind>
) -> Box<dyn Future<Item = String, Error = RedisError>>
Read info about the Redis server.
fn del<K: Into<MultipleKeys>>(
&self,
keys: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
keys: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Removes the specified keys. A key is ignored if it does not exist. Returns the number of keys removed.
fn subscribe<T: Into<String>>(
&self,
channel: T
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
channel: T
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Subscribe to a channel on the PubSub interface. Any messages received before on_message
is called will be discarded, so it's
usually best to call on_message
before calling subscribe
for the first time. The usize
returned here is the number of
channels to which the client is currently subscribed.
fn unsubscribe<T: Into<String>>(
&self,
channel: T
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
channel: T
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Unsubscribe from a channel on the PubSub interface.
fn publish<T: Into<String>, V: Into<RedisValue>>(
&self,
channel: T,
message: V
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
channel: T,
message: V
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Publish a message on the PubSub interface, returning the number of clients that received the message.
fn decr<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Decrements the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. Returns error if the key contains a value of the wrong type.
fn decrby<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
value: V
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K,
value: V
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Decrements the number stored at key by value argument. If the key does not exist, it is set to 0 before performing the operation. Returns error if the key contains a value of the wrong type.
fn incr<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. Returns an error if the value at key is of the wrong type.
fn incrby<K: Into<RedisKey>>(
&self,
key: K,
incr: i64
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K,
incr: i64
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Increments the number stored at key by incr. If the key does not exist, it is set to 0 before performing the operation. Returns an error if the value at key is of the wrong type.
fn incrbyfloat<K: Into<RedisKey>>(
&self,
key: K,
incr: f64
) -> Box<dyn Future<Item = f64, Error = RedisError>>
[src]
&self,
key: K,
incr: f64
) -> Box<dyn Future<Item = f64, Error = RedisError>>
Increment the string representing a floating point number stored at key by the argument value. If the key does not exist, it is set to 0 before performing the operation. Returns error if key value is wrong type or if the current value or increment value are not parseable as float value.
fn ping(&self) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
Ping the Redis server.
fn auth<V: Into<String>>(
&self,
value: V
) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
&self,
value: V
) -> Box<dyn Future<Item = String, Error = RedisError>>
Request for authentication in a password-protected Redis server. Returns ok if successful.
fn bgrewriteaof(&self) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
Instruct Redis to start an Append Only File rewrite process. Returns ok.
fn bgsave(&self) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
Save the DB in background. Returns ok.
fn client_list(&self) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
Returns information and statistics about the client connections.
fn client_getname(
&self
) -> Box<dyn Future<Item = Option<String>, Error = RedisError>>
[src]
&self
) -> Box<dyn Future<Item = Option<String>, Error = RedisError>>
Returns the name of the current connection as a string, or None if no name is set.
fn client_setname<V: Into<String>>(
&self,
name: V
) -> Box<dyn Future<Item = Option<String>, Error = RedisError>>
[src]
&self,
name: V
) -> Box<dyn Future<Item = Option<String>, Error = RedisError>>
Assigns a name to the current connection. Returns ok if successful, None otherwise.
fn dbsize(&self) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
Return the number of keys in the currently-selected database.
fn dump<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = Option<String>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = Option<String>, Error = RedisError>>
Serialize the value stored at key in a Redis-specific format and return it as bulk string. If key does not exist None is returned
fn exists<K: Into<MultipleKeys>>(
&self,
keys: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
keys: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Returns number of keys that exist from the keys
arguments.
fn expire<K: Into<RedisKey>>(
&self,
key: K,
seconds: i64
) -> Box<dyn Future<Item = bool, Error = RedisError>>
[src]
&self,
key: K,
seconds: i64
) -> Box<dyn Future<Item = bool, Error = RedisError>>
Set a timeout on key. After the timeout has expired, the key will automatically be deleted.
Returns true
if timeout set, false
if key does not exist.
fn expire_at<K: Into<RedisKey>>(
&self,
key: K,
timestamp: i64
) -> Box<dyn Future<Item = bool, Error = RedisError>>
[src]
&self,
key: K,
timestamp: i64
) -> Box<dyn Future<Item = bool, Error = RedisError>>
Set a timeout on key based on a UNIX timestamp. After the timeout has expired, the key will automatically be deleted.
Returns true
if timeout set, false
if key does not exist.
fn persist<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = bool, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = bool, Error = RedisError>>
Remove the existing timeout on key, turning the key from volatile (a key with an expire set)
to persistent (a key that will never expire as no timeout is associated).
Return true
if timeout was removed, false
if key does not exist
fn flushdb(
&self,
_async: bool
) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
&self,
_async: bool
) -> Box<dyn Future<Item = String, Error = RedisError>>
Delete all the keys in the currently selected database. Returns a string reply.
fn getrange<K: Into<RedisKey>>(
&self,
key: K,
start: usize,
end: usize
) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
&self,
key: K,
start: usize,
end: usize
) -> Box<dyn Future<Item = String, Error = RedisError>>
Returns the substring of the string value stored at key, determined by the offsets start and end (both inclusive). Note: Command formerly called SUBSTR in Redis verison <=2.0.
fn getset<V: Into<RedisValue>, K: Into<RedisKey>>(
&self,
key: K,
value: V
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
value: V
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
Atomically sets key to value and returns the old value stored at key. Returns error if key does not hold string value. Returns None if key does not exist.
fn hdel<F: Into<MultipleKeys>, K: Into<RedisKey>>(
&self,
key: K,
fields: F
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
fields: F
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored. If key does not exist, it is treated as an empty hash and this command returns 0.
fn hexists<F: Into<RedisKey>, K: Into<RedisKey>>(
&self,
key: K,
field: F
) -> Box<dyn Future<Item = bool, Error = RedisError>>
[src]
&self,
key: K,
field: F
) -> Box<dyn Future<Item = bool, Error = RedisError>>
Returns true
if field
exists on key
.
fn hget<F: Into<RedisKey>, K: Into<RedisKey>>(
&self,
key: K,
field: F
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
field: F
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
Returns the value associated with field in the hash stored at key.
fn hgetall<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = HashMap<String, RedisValue>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = HashMap<String, RedisValue>, Error = RedisError>>
Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value Returns an empty hashmap if hash is empty.
fn hincrby<F: Into<RedisKey>, K: Into<RedisKey>>(
&self,
key: K,
field: F,
incr: i64
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K,
field: F,
incr: i64
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Increments the number stored at field
in the hash stored at key
by incr
. If key does not exist, a new key holding a hash is created.
If field does not exist the value is set to 0 before the operation is performed.
fn hincrbyfloat<K: Into<RedisKey>, F: Into<RedisKey>>(
&self,
key: K,
field: F,
incr: f64
) -> Box<dyn Future<Item = f64, Error = RedisError>>
[src]
&self,
key: K,
field: F,
incr: f64
) -> Box<dyn Future<Item = f64, Error = RedisError>>
Increment the specified field
of a hash stored at key
, and representing a floating point number, by the specified increment.
If the field does not exist, it is set to 0 before performing the operation.
Returns an error if field value contains wrong type or content/increment are not parsable.
fn hkeys<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = Vec<String>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = Vec<String>, Error = RedisError>>
Returns all field names in the hash stored at key. Returns an empty vec if the list is empty. Null fields are converted to "nil".
fn hlen<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Returns the number of fields contained in the hash stored at key.
fn hmget<F: Into<MultipleKeys>, K: Into<RedisKey>>(
&self,
key: K,
fields: F
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
fields: F
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Returns the values associated with the specified fields in the hash stored at key. Values in a returned list may be null.
fn hmset<V: Into<RedisValue>, F: Into<RedisKey> + Hash + Eq, K: Into<RedisKey>>(
&self,
key: K,
values: HashMap<F, V>
) -> Box<dyn Future<Item = String, Error = RedisError>>
[src]
&self,
key: K,
values: HashMap<F, V>
) -> Box<dyn Future<Item = String, Error = RedisError>>
Sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created.
fn hset<K: Into<RedisKey>, F: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten. Note: Return value of 1 means new field was created and set. Return of 0 means field already exists and was overwritten.
fn hsetnx<K: Into<RedisKey>, F: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Sets field in the hash stored at key to value, only if field does not yet exist. If key does not exist, a new key holding a hash is created. Note: Return value of 1 means new field was created and set. Return of 0 means no operation performed.
fn hstrlen<K: Into<RedisKey>, F: Into<RedisKey>>(
&self,
key: K,
field: F
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
field: F
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Returns the string length of the value associated with field in the hash stored at key. If the key or the field do not exist, 0 is returned.
fn hvals<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Returns all values in the hash stored at key. Returns an empty vector if the list is empty.
fn llen<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at key is not a list.
fn lpush<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
value: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
value: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Insert the specified value at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.
fn lpop<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = Option<RedisValue>, Error = RedisError>>
Removes and returns the first element of the list stored at key.
fn sadd<K: Into<RedisKey>, V: Into<MultipleValues>>(
&self,
key: K,
values: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
values: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Add the specified value to the set stored at key. Values that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified value. An error is returned when the value stored at key is not a set.
fn srem<K: Into<RedisKey>, V: Into<MultipleValues>>(
&self,
key: K,
values: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
values: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Remove the specified value from the set stored at key. Values that are not a member of this set are ignored. If key does not exist, it is treated as an empty set and this command returns 0. An error is returned when the value stored at key is not a set.
fn smembers<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Returns all the members of the set value stored at key. This has the same effect as running SINTER with one argument key.
fn psubscribe<K: Into<MultipleKeys>>(
&self,
patterns: K
) -> Box<dyn Future<Item = Vec<usize>, Error = RedisError>>
[src]
&self,
patterns: K
) -> Box<dyn Future<Item = Vec<usize>, Error = RedisError>>
Subscribes the client to the given patterns.
Returns the subscription count for each of the provided patterns.
fn punsubscribe<K: Into<MultipleKeys>>(
&self,
patterns: K
) -> Box<dyn Future<Item = Vec<usize>, Error = RedisError>>
[src]
&self,
patterns: K
) -> Box<dyn Future<Item = Vec<usize>, Error = RedisError>>
Unsubscribes the client from the given patterns, or from all of them if none is given.
Returns the subscription count for each of the provided patterns.
fn mget<K: Into<MultipleKeys>>(
&self,
keys: K
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
keys: K
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Returns the values of all specified keys.
fn zadd<K: Into<RedisKey>, V: Into<MultipleZaddValues>>(
&self,
key: K,
options: Option<SetOptions>,
changed: bool,
incr: bool,
values: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
[src]
&self,
key: K,
options: Option<SetOptions>,
changed: bool,
incr: bool,
values: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
Adds all the specified members with the specified scores to the sorted set stored at key.
fn zcard<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Returns the sorted set cardinality (number of elements) of the sorted set stored at key.
fn zcount<K: Into<RedisKey>>(
&self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Returns the number of elements in the sorted set at key with a score between min and max.
fn zlexcount<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
&self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = usize, Error = RedisError>>
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.
fn zincrby<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
incr: f64,
value: V
) -> Box<dyn Future<Item = f64, Error = RedisError>>
[src]
&self,
key: K,
incr: f64,
value: V
) -> Box<dyn Future<Item = f64, Error = RedisError>>
Increments the score of member in the sorted set stored at key by increment.
fn zrange<K: Into<RedisKey>>(
&self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Returns the specified range of elements in the sorted set stored at key.
fn zrangebylex<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
&self,
key: K,
min: M,
max: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
min: M,
max: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
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.
fn zrangebyscore<K: Into<RedisKey>>(
&self,
key: K,
min: f64,
max: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
min: f64,
max: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
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).
fn zpopmax<K: Into<RedisKey>>(
&self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Removes and returns up to count members with the highest scores in the sorted set stored at key.
fn zpopmin<K: Into<RedisKey>>(
&self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Removes and returns up to count members with the lowest scores in the sorted set stored at key.
fn zrank<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
value: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
[src]
&self,
key: K,
value: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.
fn zrem<K: Into<RedisKey>, V: Into<MultipleValues>>(
&self,
key: K,
values: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
values: V
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Removes the specified members from the sorted set stored at key. Non existing members are ignored.
fn zremrangebylex<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
&self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = usize, Error = RedisError>>
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.
fn zremrangebyrank<K: Into<RedisKey>>(
&self,
key: K,
start: i64,
stop: i64
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
start: i64,
stop: i64
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Removes all elements in the sorted set stored at key with rank between start and stop.
fn zremrangebyscore<K: Into<RedisKey>>(
&self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Removes all elements in the sorted set stored at key with a score between min and max (inclusive).
fn zrevrange<K: Into<RedisKey>>(
&self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
Returns the specified range of elements in the sorted set stored at key. The elements are considered to be ordered from the highest to the lowest score
fn zrevrangebylex<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
&self,
key: K,
max: M,
min: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
max: M,
min: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
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.
fn zrevrangebyscore<K: Into<RedisKey>>(
&self,
key: K,
max: f64,
min: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
[src]
&self,
key: K,
max: f64,
min: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = Vec<RedisValue>, Error = RedisError>>
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). In contrary to the default ordering of sorted sets, for this command the elements are considered to be ordered from high to low scores.
fn zrevrank<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
value: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
[src]
&self,
key: K,
value: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
fn zscore<K: Into<RedisKey>, V: Into<RedisValue>>(
&self,
key: K,
value: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
[src]
&self,
key: K,
value: V
) -> Box<dyn Future<Item = RedisValue, Error = RedisError>>
Returns the score of member in the sorted set at key.
fn zinterstore<D: Into<RedisKey>, K: Into<MultipleKeys>, W: Into<MultipleWeights>>(
&self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.
fn zunionstore<D: Into<RedisKey>, K: Into<MultipleKeys>, W: Into<MultipleWeights>>(
&self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = usize, Error = RedisError>>
[src]
&self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = usize, Error = RedisError>>
Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.
fn ttl<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Returns the remaining time to live of a key that has a timeout. This introspection capability allows a Redis client to check how many seconds a given key will continue to be part of the dataset.
fn pttl<K: Into<RedisKey>>(
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
[src]
&self,
key: K
) -> Box<dyn Future<Item = i64, Error = RedisError>>
Like TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.
impl RedisClientOwned for RedisClient
[src]
fn get<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
Read a value from Redis at key
.
fn quit(self) -> Box<dyn Future<Item = Self, Error = RedisError>>
[src]
Close the connection to the Redis server. 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
or connect_with_policy
will resolve, and that indicates that the connection has been fully closed.
This function will also close all error, message, and reconnection event streams.
Note: This function will immediately succeed if the client is already disconnected. This is to allow quit
to be used
a means to break out from reconnect logic. If this function is called while the client is waiting to attempt to reconnect
then when it next wakes up to try to reconnect it will instead break out with a RedisErrorKind::Canceled
error.
This in turn will resolve the future returned by connect
or connect_with_policy
some time later.
fn flushall(
self,
_async: bool
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self,
_async: bool
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Delete the keys in all databases. Returns a string reply.
fn set<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
value: V,
expire: Option<Expiration>,
options: Option<SetOptions>
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
[src]
self,
key: K,
value: V,
expire: Option<Expiration>,
options: Option<SetOptions>
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
Set a value at key
with optional NX|XX and EX|PX arguments.
The bool
returned by this function describes whether or not the key was set due to any NX|XX options.
fn select(self, db: u8) -> Box<dyn Future<Item = Self, Error = RedisError>>
[src]
Select the database this client should use.
fn info(
self,
section: Option<InfoKind>
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self,
section: Option<InfoKind>
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Read info about the Redis server.
fn del<K: Into<MultipleKeys>>(
self,
keys: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
keys: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Removes the specified keys. A key is ignored if it does not exist. Returns the number of keys removed.
fn subscribe<T: Into<String>>(
self,
channel: T
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
channel: T
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Subscribe to a channel on the PubSub interface. Any messages received before on_message
is called will be discarded, so it's
usually best to call on_message
before calling subscribe
for the first time. The usize
returned here is the number of
channels to which the client is currently subscribed.
fn unsubscribe<T: Into<String>>(
self,
channel: T
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
channel: T
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Unsubscribe from a channel on the PubSub interface.
fn publish<T: Into<String>, V: Into<RedisValue>>(
self,
channel: T,
message: V
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
channel: T,
message: V
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Publish a message on the PubSub interface, returning the number of clients that received the message.
fn decr<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Decrements the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. Returns error if the key contains a value of the wrong type.
fn decrby<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Decrements the number stored at key by value argument. If the key does not exist, it is set to 0 before performing the operation. Returns error if the key contains a value of the wrong type.
fn incr<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. Returns an error if the value at key is of the wrong type.
fn incrby<K: Into<RedisKey>>(
self,
key: K,
incr: i64
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K,
incr: i64
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Increments the number stored at key by incr. If the key does not exist, it is set to 0 before performing the operation. Returns an error if the value at key is of the wrong type.
fn incrbyfloat<K: Into<RedisKey>>(
self,
key: K,
incr: f64
) -> Box<dyn Future<Item = (Self, f64), Error = RedisError>>
[src]
self,
key: K,
incr: f64
) -> Box<dyn Future<Item = (Self, f64), Error = RedisError>>
Increment the string representing a floating point number stored at key by the argument value. If the key does not exist, it is set to 0 before performing the operation. Returns error if key value is wrong type or if the current value or increment value are not parseable as float value.
fn ping(self) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
Ping the Redis server.
fn auth<V: Into<String>>(
self,
value: V
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self,
value: V
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Request for authentication in a password-protected Redis server. Returns ok if successful.
fn bgrewriteaof(
self
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Instruct Redis to start an Append Only File rewrite process. Returns ok.
fn bgsave(self) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
Save the DB in background. Returns ok.
fn client_list(
self
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Returns information and statistics about the client connections.
fn client_getname(
self
) -> Box<dyn Future<Item = (Self, Option<String>), Error = RedisError>>
[src]
self
) -> Box<dyn Future<Item = (Self, Option<String>), Error = RedisError>>
Returns the name of the current connection as a string, or None if no name is set.
fn client_setname<V: Into<String>>(
self,
name: V
) -> Box<dyn Future<Item = (Self, Option<String>), Error = RedisError>>
[src]
self,
name: V
) -> Box<dyn Future<Item = (Self, Option<String>), Error = RedisError>>
Assigns a name to the current connection. Returns ok if successful, None otherwise.
fn dbsize(self) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
Return the number of keys in the currently-selected database.
fn dump<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, Option<String>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, Option<String>), Error = RedisError>>
Serialize the value stored at key in a Redis-specific format and return it as bulk string. If key does not exist None is returned
fn exists<K: Into<MultipleKeys>>(
self,
keys: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
keys: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Returns number of keys that exist from the keys
arguments.
fn expire<K: Into<RedisKey>>(
self,
key: K,
seconds: i64
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
[src]
self,
key: K,
seconds: i64
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
Set a timeout on key. After the timeout has expired, the key will automatically be deleted.
Returns true
if timeout set, false
if key does not exist.
fn expire_at<K: Into<RedisKey>>(
self,
key: K,
timestamp: i64
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
[src]
self,
key: K,
timestamp: i64
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
Set a timeout on key based on a UNIX timestamp. After the timeout has expired, the key will automatically be deleted.
Returns true
if timeout set, false
if key does not exist.
fn persist<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
Remove the existing timeout on key, turning the key from volatile (a key with an expire set)
to persistent (a key that will never expire as no timeout is associated).
Return true
if timeout was removed, false
if key does not exist
fn flushdb(
self,
_async: bool
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self,
_async: bool
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Delete all the keys in the currently selected database. Returns a string reply.
fn getrange<K: Into<RedisKey>>(
self,
key: K,
start: usize,
end: usize
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self,
key: K,
start: usize,
end: usize
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Returns the substring of the string value stored at key, determined by the offsets start and end (both inclusive). Note: Command formerly called SUBSTR in Redis verison <=2.0.
fn getset<V: Into<RedisValue>, K: Into<RedisKey>>(
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
Atomically sets key to value and returns the old value stored at key. Returns error if key does not hold string value. Returns None if key does not exist.
fn hdel<F: Into<MultipleKeys>, K: Into<RedisKey>>(
self,
key: K,
fields: F
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
fields: F
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored. If key does not exist, it is treated as an empty hash and this command returns 0.
fn hexists<F: Into<RedisKey>, K: Into<RedisKey>>(
self,
key: K,
field: F
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
[src]
self,
key: K,
field: F
) -> Box<dyn Future<Item = (Self, bool), Error = RedisError>>
Returns true
if field
exists on key
.
fn hget<F: Into<RedisKey>, K: Into<RedisKey>>(
self,
key: K,
field: F
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
field: F
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
Returns the value associated with field in the hash stored at key.
fn hgetall<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, HashMap<String, RedisValue>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, HashMap<String, RedisValue>), Error = RedisError>>
Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value Returns an empty hashmap if hash is empty.
fn hincrby<F: Into<RedisKey>, K: Into<RedisKey>>(
self,
key: K,
field: F,
incr: i64
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K,
field: F,
incr: i64
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Increments the number stored at field
in the hash stored at key
by incr
. If key does not exist, a new key holding a hash is created.
If field does not exist the value is set to 0 before the operation is performed.
fn hincrbyfloat<K: Into<RedisKey>, F: Into<RedisKey>>(
self,
key: K,
field: F,
incr: f64
) -> Box<dyn Future<Item = (Self, f64), Error = RedisError>>
[src]
self,
key: K,
field: F,
incr: f64
) -> Box<dyn Future<Item = (Self, f64), Error = RedisError>>
Increment the specified field
of a hash stored at key
, and representing a floating point number, by the specified increment.
If the field does not exist, it is set to 0 before performing the operation.
Returns an error if field value contains wrong type or content/increment are not parsable.
fn hkeys<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, Vec<String>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, Vec<String>), Error = RedisError>>
Returns all field names in the hash stored at key. Returns an empty vec if the list is empty. Null fields are converted to "nil".
fn hlen<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Returns the number of fields contained in the hash stored at key.
fn hmget<F: Into<MultipleKeys>, K: Into<RedisKey>>(
self,
key: K,
fields: F
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
fields: F
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Returns the values associated with the specified fields in the hash stored at key. Values in a returned list may be null.
fn hmset<V: Into<RedisValue>, F: Into<RedisKey> + Hash + Eq, K: Into<RedisKey>>(
self,
key: K,
values: HashMap<F, V>
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
[src]
self,
key: K,
values: HashMap<F, V>
) -> Box<dyn Future<Item = (Self, String), Error = RedisError>>
Sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created.
fn hset<K: Into<RedisKey>, F: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten. Note: Return value of 1 means new field was created and set. Return of 0 means field already exists and was overwritten.
fn hsetnx<K: Into<RedisKey>, F: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
field: F,
value: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Sets field in the hash stored at key to value, only if field does not yet exist. If key does not exist, a new key holding a hash is created. Note: Return value of 1 means new field was created and set. Return of 0 means no operation performed.
fn hstrlen<K: Into<RedisKey>, F: Into<RedisKey>>(
self,
key: K,
field: F
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
field: F
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Returns the string length of the value associated with field in the hash stored at key. If the key or the field do not exist, 0 is returned.
fn hvals<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Returns all values in the hash stored at key. Returns an empty vector if the list is empty.
fn llen<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at key is not a list.
fn lpush<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Insert the specified value at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.
fn lpop<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, Option<RedisValue>), Error = RedisError>>
Removes and returns the first element of the list stored at key.
fn sadd<K: Into<RedisKey>, V: Into<MultipleValues>>(
self,
key: K,
values: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
values: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Add the specified value to the set stored at key. Values that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified value. An error is returned when the value stored at key is not a set.
fn srem<K: Into<RedisKey>, V: Into<MultipleValues>>(
self,
key: K,
values: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
values: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Remove the specified value from the set stored at key. Values that are not a member of this set are ignored. If key does not exist, it is treated as an empty set and this command returns 0. An error is returned when the value stored at key is not a set.
fn smembers<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Returns all the members of the set value stored at key. This has the same effect as running SINTER with one argument key.
fn psubscribe<K: Into<MultipleKeys>>(
self,
patterns: K
) -> Box<dyn Future<Item = (Self, Vec<usize>), Error = RedisError>>
[src]
self,
patterns: K
) -> Box<dyn Future<Item = (Self, Vec<usize>), Error = RedisError>>
Subscribes the client to the given patterns.
Returns the subscription count for each of the provided patterns.
fn punsubscribe<K: Into<MultipleKeys>>(
self,
patterns: K
) -> Box<dyn Future<Item = (Self, Vec<usize>), Error = RedisError>>
[src]
self,
patterns: K
) -> Box<dyn Future<Item = (Self, Vec<usize>), Error = RedisError>>
Unsubscribes the client from the given patterns, or from all of them if none is given.
Returns the subscription count for each of the provided patterns.
fn mget<K: Into<MultipleKeys>>(
self,
keys: K
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
keys: K
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Returns the values of all specified keys.
fn zadd<K: Into<RedisKey>, V: Into<MultipleZaddValues>>(
self,
key: K,
options: Option<SetOptions>,
changed: bool,
incr: bool,
values: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
[src]
self,
key: K,
options: Option<SetOptions>,
changed: bool,
incr: bool,
values: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
Adds all the specified members with the specified scores to the sorted set stored at key.
fn zcard<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Returns the sorted set cardinality (number of elements) of the sorted set stored at key.
fn zcount<K: Into<RedisKey>>(
self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Returns the number of elements in the sorted set at key with a score between min and max.
fn zlexcount<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
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.
fn zincrby<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
incr: f64,
value: V
) -> Box<dyn Future<Item = (Self, f64), Error = RedisError>>
[src]
self,
key: K,
incr: f64,
value: V
) -> Box<dyn Future<Item = (Self, f64), Error = RedisError>>
Increments the score of member in the sorted set stored at key by increment.
fn zrange<K: Into<RedisKey>>(
self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Returns the specified range of elements in the sorted set stored at key.
fn zrangebylex<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
self,
key: K,
min: M,
max: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
min: M,
max: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
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.
fn zrangebyscore<K: Into<RedisKey>>(
self,
key: K,
min: f64,
max: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
min: f64,
max: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
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).
fn zpopmax<K: Into<RedisKey>>(
self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Removes and returns up to count members with the highest scores in the sorted set stored at key.
fn zpopmin<K: Into<RedisKey>>(
self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
count: Option<usize>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Removes and returns up to count members with the lowest scores in the sorted set stored at key.
fn zrank<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
[src]
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.
fn zrem<K: Into<RedisKey>, V: Into<MultipleValues>>(
self,
key: K,
values: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
values: V
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Removes the specified members from the sorted set stored at key. Non existing members are ignored.
fn zremrangebylex<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
min: M,
max: N
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
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.
fn zremrangebyrank<K: Into<RedisKey>>(
self,
key: K,
start: i64,
stop: i64
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
start: i64,
stop: i64
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Removes all elements in the sorted set stored at key with rank between start and stop.
fn zremrangebyscore<K: Into<RedisKey>>(
self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
key: K,
min: f64,
max: f64
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Removes all elements in the sorted set stored at key with a score between min and max (inclusive).
fn zrevrange<K: Into<RedisKey>>(
self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
start: i64,
stop: i64,
with_scores: bool
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
Returns the specified range of elements in the sorted set stored at key. The elements are considered to be ordered from the highest to the lowest score
fn zrevrangebylex<K: Into<RedisKey>, M: Into<String>, N: Into<String>>(
self,
key: K,
max: M,
min: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
max: M,
min: N,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
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.
fn zrevrangebyscore<K: Into<RedisKey>>(
self,
key: K,
max: f64,
min: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
[src]
self,
key: K,
max: f64,
min: f64,
with_scores: bool,
limit: Option<(usize, usize)>
) -> Box<dyn Future<Item = (Self, Vec<RedisValue>), Error = RedisError>>
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). In contrary to the default ordering of sorted sets, for this command the elements are considered to be ordered from high to low scores.
fn zrevrank<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
[src]
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
fn zscore<K: Into<RedisKey>, V: Into<RedisValue>>(
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
[src]
self,
key: K,
value: V
) -> Box<dyn Future<Item = (Self, RedisValue), Error = RedisError>>
Returns the score of member in the sorted set at key.
fn zinterstore<D: Into<RedisKey>, K: Into<MultipleKeys>, W: Into<MultipleWeights>>(
self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.
fn zunionstore<D: Into<RedisKey>, K: Into<MultipleKeys>, W: Into<MultipleWeights>>(
self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
[src]
self,
destination: D,
keys: K,
weights: W,
aggregate: Option<AggregateOptions>
) -> Box<dyn Future<Item = (Self, usize), Error = RedisError>>
Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.
fn ttl<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Returns the remaining time to live of a key that has a timeout. This introspection capability allows a Redis client to check how many seconds a given key will continue to be part of the dataset.
fn pttl<K: Into<RedisKey>>(
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
[src]
self,
key: K
) -> Box<dyn Future<Item = (Self, i64), Error = RedisError>>
Like TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.
impl Clone for RedisClient
[src]
fn clone(&self) -> RedisClient
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> From<&'a Arc<RedisClientInner>> for RedisClient
[src]
fn from(inner: &'a Arc<RedisClientInner>) -> RedisClient
[src]
impl<'a> From<&'a RedisPool> for &'a RedisClient
[src]
fn from(p: &'a RedisPool) -> &'a RedisClient
[src]
impl<'a> From<&'a RedisPool> for RedisClient
[src]
fn from(p: &'a RedisPool) -> RedisClient
[src]
impl Debug for RedisClient
[src]
impl Borrow<RedisClient> for RedisPool
[src]
fn borrow(&self) -> &RedisClient
[src]
Auto Trait Implementations
impl Unpin for RedisClient
impl Sync for RedisClient
impl Send for RedisClient
impl !UnwindSafe for RedisClient
impl !RefUnwindSafe for RedisClient
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,