Trait redis_driver::GenericCommands
source · [−]pub trait GenericCommands: CommandSend {
Show 14 methods
fn copy<S, D>(&self, source: S, destination: D) -> Copy<'_, Self>
where
S: Into<BulkString> + Send,
D: Into<BulkString> + Send,
{ ... }
fn del<K>(
&self,
keys: K
) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
where
K: IntoArgs + Send,
{ ... }
fn exists<K>(
&self,
keys: K
) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
where
K: IntoArgs + Send,
{ ... }
fn expire<K>(&self, key: K, seconds: u64) -> Expire<'_, Self>
where
K: Into<BulkString> + Send,
{ ... }
fn expireat<K>(&self, key: K, unix_time_seconds: u64) -> Expire<'_, Self>
where
K: Into<BulkString> + Send,
{ ... }
fn expiretime<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
fn move_<K>(
&self,
key: K,
db: usize
) -> Pin<Box<dyn Future<Output = Result<bool>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
fn persist<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<bool>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
fn pexpire<K>(&self, key: K, milliseconds: u64) -> Expire<'_, Self>
where
K: Into<BulkString> + Send,
{ ... }
fn pexpireat<K>(
&self,
key: K,
unix_time_milliseconds: u64
) -> Expire<'_, Self>
where
K: Into<BulkString> + Send,
{ ... }
fn pexpiretime<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
fn pttl<K>(&self, key: K) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
fn ttl<K>(&self, key: K) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
fn type_<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<String>> + '_>>
where
K: Into<BulkString> + Send,
{ ... }
}
Expand description
Provided Methods
sourcefn copy<S, D>(&self, source: S, destination: D) -> Copy<'_, Self>where
S: Into<BulkString> + Send,
D: Into<BulkString> + Send,
fn copy<S, D>(&self, source: S, destination: D) -> Copy<'_, Self>where
S: Into<BulkString> + Send,
D: Into<BulkString> + Send,
This command copies the value stored at the source key to the destination key.
See Also
EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970)
A timestamp in the past will delete the key
Return
- true if the timeout was set.
- false if the timeout was not set. e.g. key doesn’t exist, or operation skipped due to the provided arguments.
See Also
sourcefn expiretime<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>where
K: Into<BulkString> + Send,
fn expiretime<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>where
K: Into<BulkString> + Send,
Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire.
Return
Expiration Unix timestamp in seconds, or a negative value in order to signal an error (see the description below).
- The command returns -1 if the key exists but has no associated expiration time.
- The command returns -2 if the key does not exist.
See Also
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.
Return
- true if the timeout was set.
- false if the timeout was not set. e.g. key doesn’t exist, or operation skipped due to the provided arguments.
See Also
sourcefn pexpiretime<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>where
K: Into<BulkString> + Send,
fn pexpiretime<K>(
&self,
key: K
) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>where
K: Into<BulkString> + Send,
PEXPIRETIME has the same semantic as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds.
Return
Expiration Unix timestamp in milliseconds, or a negative value in order to signal an error (see the description below).
- The command returns -1 if the key exists but has no associated expiration time.
- The command returns -2 if the key does not exist.