Trait redis_driver::HashCommands
source · [−]pub trait HashCommands<T>: PrepareCommand<T> {
Show 17 methods
fn hdel<K, F, C>(&self, key: K, fields: C) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
{ ... }
fn hexists<K, F>(&self, key: K, field: F) -> CommandResult<'_, T, bool>
where
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hget<K, F, V>(&self, key: K, field: F) -> CommandResult<'_, T, V>
where
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
{ ... }
fn hgetall<K, F, V, A>(&self, key: K) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
{ ... }
fn hincrby<K, F>(
&self,
key: K,
field: F,
increment: i64
) -> CommandResult<'_, T, i64>
where
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hincrbyfloat<K, F>(
&self,
key: K,
field: F,
increment: f64
) -> CommandResult<'_, T, f64>
where
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hkeys<K, F, A>(&self, key: K) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
{ ... }
fn hlen<K>(&self, key: K) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
{ ... }
fn hmget<K, F, V, C, A>(&self, key: K, fields: C) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
{ ... }
fn hrandfield<K, F>(&self, key: K) -> CommandResult<'_, T, F>
where
K: Into<BulkString>,
F: FromValue,
{ ... }
fn hrandfields<K, F, A>(
&self,
key: K,
count: isize
) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
{ ... }
fn hrandfields_with_values<K, F, V, A>(
&self,
key: K,
count: isize
) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
{ ... }
fn hscan<K, F, V>(
&self,
key: K,
cursor: u64,
options: HScanOptions
) -> CommandResult<'_, T, (u64, Vec<(F, V)>)>
where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
{ ... }
fn hset<K, F, V, I>(&self, key: K, items: I) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
I: KeyValueArgOrCollection<F, V>,
{ ... }
fn hsetnx<K, F, V>(
&self,
key: K,
field: F,
value: V
) -> CommandResult<'_, T, bool>
where
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
{ ... }
fn hstrlen<K, F>(&self, key: K, field: F) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hvals<K, V, A>(&self, key: K) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
V: FromValue,
A: FromSingleValueArray<V>,
{ ... }
}
Expand description
Provided Methods
sourcefn hdel<K, F, C>(&self, key: K, fields: C) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
fn hdel<K, F, C>(&self, key: K, fields: C) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
sourcefn hexists<K, F>(&self, key: K, field: F) -> CommandResult<'_, T, bool>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hexists<K, F>(&self, key: K, field: F) -> CommandResult<'_, T, bool>where
K: Into<BulkString>,
F: Into<BulkString>,
sourcefn hget<K, F, V>(&self, key: K, field: F) -> CommandResult<'_, T, V>where
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
fn hget<K, F, V>(&self, key: K, field: F) -> CommandResult<'_, T, V>where
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
sourcefn hgetall<K, F, V, A>(&self, key: K) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
fn hgetall<K, F, V, A>(&self, key: K) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
sourcefn hincrby<K, F>(
&self,
key: K,
field: F,
increment: i64
) -> CommandResult<'_, T, i64>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hincrby<K, F>(
&self,
key: K,
field: F,
increment: i64
) -> CommandResult<'_, T, i64>where
K: Into<BulkString>,
F: Into<BulkString>,
sourcefn hincrbyfloat<K, F>(
&self,
key: K,
field: F,
increment: f64
) -> CommandResult<'_, T, f64>where
K: Into<BulkString>,
F: Into<BulkString>,
fn hincrbyfloat<K, F>(
&self,
key: K,
field: F,
increment: f64
) -> CommandResult<'_, T, f64>where
K: Into<BulkString>,
F: Into<BulkString>,
sourcefn hkeys<K, F, A>(&self, key: K) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
fn hkeys<K, F, A>(&self, key: K) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
sourcefn hlen<K>(&self, key: K) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
fn hlen<K>(&self, key: K) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
sourcefn hmget<K, F, V, C, A>(&self, key: K, fields: C) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
fn hmget<K, F, V, C, A>(&self, key: K, fields: C) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
sourcefn hrandfield<K, F>(&self, key: K) -> CommandResult<'_, T, F>where
K: Into<BulkString>,
F: FromValue,
fn hrandfield<K, F>(&self, key: K) -> CommandResult<'_, T, F>where
K: Into<BulkString>,
F: FromValue,
sourcefn hrandfields<K, F, A>(&self, key: K, count: isize) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
fn hrandfields<K, F, A>(&self, key: K, count: isize) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
return random fields from the hash value stored at key.
Return
- If the provided count argument is positive, return an array of distinct fields. The array’s length is either count or the hash’s number of fields (HLEN), whichever is lower.
- If called with a negative count, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.
See Also
sourcefn hrandfields_with_values<K, F, V, A>(
&self,
key: K,
count: isize
) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
fn hrandfields_with_values<K, F, V, A>(
&self,
key: K,
count: isize
) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
return random fields from the hash value stored at key.
Return
- If the provided count argument is positive, return an array of distinct fields. The array’s length is either count or the hash’s number of fields (HLEN), whichever is lower.
- If called with a negative count, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count. The optional WITHVALUES modifier changes the reply so it includes the respective values of the randomly selected hash fields.