pub trait HashCommands: CommandSend {
Show 15 methods fn hdel<K, F>(
        &self,
        key: K,
        fields: F
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString> + Send,
        F: IntoArgs + Send
, { ... } fn hexists<K, F>(
        &self,
        key: K,
        field: F
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + '_>>
   where
        K: Into<BulkString> + Send,
        F: Into<BulkString> + Send
, { ... } fn hget<'a, K, F, V>(
        &'a self,
        key: K,
        field: F
    ) -> Pin<Box<dyn Future<Output = Result<V>> + 'a>>
   where
        K: Into<BulkString> + Send,
        F: Into<BulkString> + Send,
        V: FromValue + Send + 'a
, { ... } fn hgetall<'a, K, F, V>(
        &'a self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(F, V)>>> + 'a>>
   where
        K: Into<BulkString> + Send,
        F: FromValue + Send + 'a,
        V: FromValue + Send + 'a
, { ... } fn hincrby<K, F>(
        &self,
        key: K,
        field: F,
        increment: i64
    ) -> Pin<Box<dyn Future<Output = Result<i64>> + '_>>
   where
        K: Into<BulkString> + Send,
        F: Into<BulkString> + Send
, { ... } fn hincrbyfloat<K, F>(
        &self,
        key: K,
        field: F,
        increment: f64
    ) -> Pin<Box<dyn Future<Output = Result<f64>> + '_>>
   where
        K: Into<BulkString> + Send,
        F: Into<BulkString> + Send
, { ... } fn hkeys<'a, K, F>(
        &'a self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<Vec<F>>> + 'a>>
   where
        K: Into<BulkString> + Send,
        F: FromValue + Send + 'a
, { ... } fn hlen<K>(
        &self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString> + Send
, { ... } fn hmget<'a, K, F, V>(
        &'a self,
        key: K,
        fields: F
    ) -> Pin<Box<dyn Future<Output = Result<Vec<V>>> + 'a>>
   where
        K: Into<BulkString> + Send,
        F: IntoArgs + Send,
        V: FromValue + Send + 'a
, { ... } fn hrandfield<K>(&self, key: K) -> HRandField<'_, Self>
   where
        K: Into<BulkString> + Send
, { ... } fn hscan<K>(&self, key: K, cursor: usize) -> HScan<'_, Self>
   where
        K: Into<BulkString> + Send
, { ... } fn hset<K, F, V>(
        &self,
        key: K,
        items: &[(F, V)]
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString> + Send + Sync,
        F: Into<BulkString> + Send + Sync + Clone,
        V: Into<BulkString> + Send + Sync + Clone
, { ... } fn hsetnx<K, F, V>(
        &self,
        key: K,
        field: F,
        value: V
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + '_>>
   where
        K: Into<BulkString> + Send + Sync + Copy,
        F: Into<BulkString> + Send + Sync + Copy,
        V: Into<BulkString> + Send + Sync + Copy
, { ... } fn hstrlen<K, F>(
        &self,
        key: K,
        field: F
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString> + Send + Sync + Copy,
        F: Into<BulkString> + Send + Sync + Copy
, { ... } fn hvals<'a, K, V>(
        &'a self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<Vec<V>>> + 'a>>
   where
        K: Into<BulkString> + Send + Sync + Copy,
        V: FromValue + Send + 'a
, { ... }
}
Expand description

A group of Redis commands related to Hashes

See Also

Redis Hash Commands

Provided Methods

Removes the specified fields from the hash stored at key.

Return

the number of fields that were removed from the hash, not including specified but non existing fields.

See Also

https://redis.io/commands/hdel/

Returns if field is an existing field in the hash stored at key.

Return
  • true if the hash contains field.
  • false if the hash does not contain field, or key does not exist.
See Also

https://redis.io/commands/hexists/

Returns the value associated with field in the hash stored at key.

Return

The value associated with field, or nil when field is not present in the hash or key does not exist.

See Also

https://redis.io/commands/hget/

Returns all fields and values of the hash stored at key.

Return

The list of fields and their values stored in the hash, or an empty list when key does not exist.

See Also

https://redis.io/commands/hgetall/

Increments the number stored at field in the hash stored at key by increment.

Return

The value at field after the increment operation.

See Also

https://redis.io/commands/hincrby/

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

Return

The value at field after the increment operation.

See Also

https://redis.io/commands/hincrbyfloat/

Returns all field names in the hash stored at key.

Return

The list of fields in the hash, or an empty list when key does not exist.

See Also

https://redis.io/commands/hkeys/

Returns the number of fields contained in the hash stored at key.

Return

The number of fields in the hash, or 0 when key does not exist.

See Also

https://redis.io/commands/hlen/

Returns the values associated with the specified fields in the hash stored at key.

Return

The list of values associated with the given fields, in the same order as they are requested.

See Also

https://redis.io/commands/hmget/

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

See Also

https://redis.io/commands/hrandfield/

Iterates fields of Hash types and their associated values.

Return

array of elements contain two elements, a field and a value, for every returned element of the Hash.

See Also

https://redis.io/commands/hlen/

Sets field in the hash stored at key to value.

Return

The number of fields that were added.

See Also

https://redis.io/commands/hset/

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

Return
  • true if field is a new field in the hash and value was set.
  • false if field already exists in the hash and no operation was performed.
See Also

https://redis.io/commands/hsetnx/

Returns the string length of the value associated with field in the hash stored at key.

Return

the string length of the value associated with field, or zero when field is not present in the hash or key does not exist at all.

See Also

https://redis.io/commands/hstrlen/

list of values in the hash, or an empty list when key does not exist.

Return

The list of values in the hash, or an empty list when key does not exist.

See Also

https://redis.io/commands/hvals/

Implementors