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

A group of generic Redis commands

See Also

Redis Generic Commands

Provided Methods

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

See Also

https://redis.io/commands/copy/

Removes the specified keys. A key is ignored if it does not exist.

Return

The number of keys that were removed.

See Also

https://redis.io/commands/del/

Returns if keys exist.

Return

The number of keys that exist from those specified as arguments.

See Also

https://redis.io/commands/exists/

Set a timeout on key in 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

https://redis.io/commands/expire/

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

https://redis.io/commands/expireat/

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

https://redis.io/commands/expiretime/

Move key from the currently selected database to the specified destination database.

Return
  • true if key was moved.
  • false f key was not moved.
See Also

https://redis.io/commands/move/

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 the timeout was removed.
  • false if key does not exist or does not have an associated timeout.
See Also

https://redis.io/commands/persist/

This command works exactly like EXPIRE but the time to live of the key 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

https://redis.io/commands/pexpire/

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

https://redis.io/commands/pexpireat/

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.
See Also

https://redis.io/commands/pexpiretime/

Returns the remaining time to live of a key that has a timeout.

Return

TTL in milliseconds, or a negative value in order to signal an error: -2 if the key does not exist. -1 if the key exists but has no associated expire.

See Also

https://redis.io/commands/pttl/

Returns the remaining time to live of a key that has a timeout.

Return

TTL in seconds, or a negative value in order to signal an error: -2 if the key does not exist. -1 if the key exists but has no associated expire.

See Also

https://redis.io/commands/ttl/

Returns the string representation of the type of the value stored at key.

The different types that can be returned are: string, list, set, zset, hash and stream.

Return

type of key, or empty string when key does not exist.

See Also

https://redis.io/commands/type/

Implementors