Skip to content

Commit

Permalink
add object commands
Browse files Browse the repository at this point in the history
ENCODING, IDLETIME, FREQ, REFCOUNT
closes: #599
  • Loading branch information
Roger committed May 16, 2022
1 parent 6cadc14 commit 5ca67e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/commands.rs
Expand Up @@ -996,6 +996,28 @@ implement_commands! {
cmd("PUBLISH").arg(channel).arg(message)
}

// Object commands

/// Returns the encoding of a key.
fn object_encoding<K: ToRedisArgs>(key: K) {
cmd("OBJECT").arg("ENCODING").arg(key)
}

/// Returns the time in seconds since the last access of a key.
fn object_idletime<K: ToRedisArgs>(key: K) {
cmd("OBJECT").arg("IDLETIME").arg(key)
}

/// Returns the logarithmic access frequency counter of a key.
fn object_freq<K: ToRedisArgs>(key: K) {
cmd("OBJECT").arg("FREQ").arg(key)
}

/// Returns the reference count of a key.
fn object_refcount<K: ToRedisArgs>(key: K) {
cmd("OBJECT").arg("REFCOUNT").arg(key)
}

// ACL commands

/// When Redis is configured to use an ACL file (with the aclfile
Expand Down

0 comments on commit 5ca67e7

Please sign in to comment.