pub trait HashCommands {
Show 17 methods
// Provided methods
fn hdel<K, F, C>(
&mut self,
key: K,
fields: C,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg>,
C: SingleArgOrCollection<F> { ... }
fn hexists<K, F>(
&mut self,
key: K,
field: F,
) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg> { ... }
fn hget<K, F, V>(
&mut self,
key: K,
field: F,
) -> PreparedCommand<'_, Self, V>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg>,
V: FromValue { ... }
fn hgetall<K, F, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized,
K: Into<CommandArg>,
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<CommandArg>,
F: Into<CommandArg> { ... }
fn hincrbyfloat<K, F>(
&mut self,
key: K,
field: F,
increment: f64,
) -> PreparedCommand<'_, Self, f64>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg> { ... }
fn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized,
K: Into<CommandArg>,
F: FromValue,
A: FromSingleValueArray<F> { ... }
fn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg> { ... }
fn hmget<K, F, V, C, A>(
&mut self,
key: K,
fields: C,
) -> PreparedCommand<'_, Self, A>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V> { ... }
fn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>
where Self: Sized,
K: Into<CommandArg>,
F: FromValue { ... }
fn hrandfields<K, F, A>(
&mut self,
key: K,
count: isize,
) -> PreparedCommand<'_, Self, A>
where Self: Sized,
K: Into<CommandArg>,
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<CommandArg>,
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<CommandArg>,
F: FromValue,
V: FromValue { ... }
fn hset<K, F, V, I>(
&mut self,
key: K,
items: I,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg>,
V: Into<CommandArg>,
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<CommandArg>,
F: Into<CommandArg>,
V: Into<CommandArg> { ... }
fn hstrlen<K, F>(
&mut self,
key: K,
field: F,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg> { ... }
fn hvals<K, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized,
K: Into<CommandArg>,
V: FromValue,
A: FromSingleValueArray<V> { ... }
}
Expand description
Provided Methods§
Sourcefn hdel<K, F, C>(
&mut self,
key: K,
fields: C,
) -> PreparedCommand<'_, Self, usize>
fn hdel<K, F, C>( &mut self, key: K, fields: C, ) -> PreparedCommand<'_, Self, usize>
Sourcefn hexists<K, F>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, bool>
fn hexists<K, F>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, bool>
Sourcefn hget<K, F, V>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, V>
fn hget<K, F, V>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, V>
Sourcefn hgetall<K, F, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<CommandArg>,
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<CommandArg>,
F: FromValue,
V: FromValue,
A: FromKeyValueValueArray<F, V>,
Sourcefn hincrby<K, F>(
&mut self,
key: K,
field: F,
increment: i64,
) -> PreparedCommand<'_, Self, i64>
fn hincrby<K, F>( &mut self, key: K, field: F, increment: i64, ) -> PreparedCommand<'_, Self, i64>
Sourcefn hincrbyfloat<K, F>(
&mut self,
key: K,
field: F,
increment: f64,
) -> PreparedCommand<'_, Self, f64>
fn hincrbyfloat<K, F>( &mut self, key: K, field: F, increment: f64, ) -> PreparedCommand<'_, Self, f64>
Sourcefn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
fn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
Sourcefn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
fn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
Sourcefn hmget<K, F, V, C, A>(
&mut self,
key: K,
fields: C,
) -> PreparedCommand<'_, Self, A>where
Self: Sized,
K: Into<CommandArg>,
F: Into<CommandArg>,
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<CommandArg>,
F: Into<CommandArg>,
C: SingleArgOrCollection<F>,
V: FromValue,
A: FromSingleValueArray<V>,
Sourcefn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>
fn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>
Sourcefn hrandfields<K, F, A>(
&mut self,
key: K,
count: isize,
) -> PreparedCommand<'_, Self, A>
fn hrandfields<K, F, A>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, Self, A>
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<CommandArg>,
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<CommandArg>,
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.