Trait redis_driver::HashCommands
source · pub trait HashCommands {
Show 17 methods
fn hdel<K, F, C>(
&mut self,
key: K,
fields: C
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
{ ... }
fn hexists<K, F>(
&mut self,
key: K,
field: F
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hget<K, F, V>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, V>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
{ ... }
fn hgetall<K, F, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
{ ... }
fn hincrby<K, F>(
&mut self,
key: K,
field: F,
increment: i64
) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hincrbyfloat<K, F>(
&mut self,
key: K,
field: F,
increment: f64
) -> PreparedCommand<'_, Self, f64>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
{ ... }
fn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn hmget<K, F, V, C, A>(
&mut self,
key: K,
fields: C
) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
{ ... }
fn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>
where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
{ ... }
fn hrandfields<K, F, A>(
&mut self,
key: K,
count: isize
) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
{ ... }
fn hrandfields_with_values<K, F, V, A>(
&mut self,
key: K,
count: isize
) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
{ ... }
fn hscan<K, F, V>(
&mut self,
key: K,
cursor: u64,
options: HScanOptions
) -> PreparedCommand<'_, Self, (u64, Vec<(F, V)>)>
where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
V: FromValue,
{ ... }
fn hset<K, F, V, I>(
&mut self,
key: K,
items: I
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
I: KeyValueArgOrCollection<F, V>,
{ ... }
fn hsetnx<K, F, V>(
&mut self,
key: K,
field: F,
value: V
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
V: Into<BulkString>,
{ ... }
fn hstrlen<K, F>(
&mut self,
key: K,
field: F
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
{ ... }
fn hvals<K, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
V: FromValue,
A: FromSingleValueArray<V>,
{ ... }
}
Expand description
Provided Methods
sourcefn hdel<K, F, C>(&mut self, key: K, fields: C) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
fn hdel<K, F, C>(&mut self, key: K, fields: C) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
sourcefn hexists<K, F>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
fn hexists<K, F>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
sourcefn hget<K, F, V>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, V>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
fn hget<K, F, V>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, V>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
V: FromValue,
sourcefn hgetall<K, F, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
fn hgetall<K, F, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
sourcefn hincrby<K, F>(
&mut self,
key: K,
field: F,
increment: i64
) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
fn hincrby<K, F>(
&mut self,
key: K,
field: F,
increment: i64
) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
sourcefn hincrbyfloat<K, F>(
&mut self,
key: K,
field: F,
increment: f64
) -> PreparedCommand<'_, Self, f64>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
fn hincrbyfloat<K, F>(
&mut self,
key: K,
field: F,
increment: f64
) -> PreparedCommand<'_, Self, f64>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
sourcefn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
fn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
sourcefn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
fn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
sourcefn hmget<K, F, V, C, A>(
&mut self,
key: K,
fields: C
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
fn hmget<K, F, V, C, A>(
&mut self,
key: K,
fields: C
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: Into<BulkString>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
sourcefn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
fn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
sourcefn hrandfields<K, F, A>(
&mut self,
key: K,
count: isize
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
A: FromSingleValueArray<F>,
fn hrandfields<K, F, A>(
&mut self,
key: K,
count: isize
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
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>(
&mut self,
key: K,
count: isize
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<BulkString>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
fn hrandfields_with_values<K, F, V, A>(
&mut self,
key: K,
count: isize
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
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.