Trait fred::interfaces::SetsInterface
source · pub trait SetsInterface: ClientLike + Sized {
Show 15 methods
// Provided methods
fn sadd<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
fn scard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn sdiff<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn sdiffstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
K: Into<MultipleKeys> { ... }
fn sinter<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn sinterstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
K: Into<MultipleKeys> { ... }
fn sismember<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn smismember<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
fn smembers<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn smove<R, S, D, V>(
&self,
source: S,
dest: D,
member: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<RedisKey>,
D: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn spop<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn srandmember<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn srem<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
fn sunion<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<MultipleKeys> { ... }
fn sunionstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
K: Into<MultipleKeys> { ... }
}i-sets only.Expand description
Functions that implement the sets interface.
Provided Methods§
sourcefn sadd<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn sadd<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Add the specified members to the set stored at key.
sourcefn scard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
fn scard<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
Returns the set cardinality (number of elements) of the set stored at key.
sourcefn sdiff<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
fn sdiff<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
Returns the members of the set resulting from the difference between the first set and all the successive sets.
sourcefn sdiffstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
fn sdiffstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>
This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.
sourcefn sinter<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
fn sinter<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
Returns the members of the set resulting from the intersection of all the given sets.
sourcefn sinterstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
fn sinterstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>
This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.
sourcefn sismember<R, K, V>(
&self,
key: K,
member: V,
) -> impl Future<Output = RedisResult<R>>
fn sismember<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = RedisResult<R>>
Returns if member is a member of the set stored at key.
sourcefn smismember<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn smismember<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Returns whether each member is a member of the set stored at key.
sourcefn smembers<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
fn smembers<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
Returns all the members of the set value stored at key.
sourcefn smove<R, S, D, V>(
&self,
source: S,
dest: D,
member: V,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
S: Into<RedisKey>,
D: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError>,
fn smove<R, S, D, V>(
&self,
source: S,
dest: D,
member: V,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
S: Into<RedisKey>,
D: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError>,
Move member from the set at source to the set at destination.
sourcefn spop<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
fn spop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
Removes and returns one or more random members from the set value store at key.
sourcefn srandmember<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
fn srandmember<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
When called with just the key argument, return a random element from the set value stored at key.
If the provided count argument is positive, return an array of distinct elements. The array’s length is either
count or the set’s cardinality (SCARD), whichever is lower.
sourcefn srem<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn srem<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Remove the specified members from the set stored at key.
sourcefn sunion<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
fn sunion<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
Returns the members of the set resulting from the union of all the given sets.
sourcefn sunionstore<R, D, K>(
&self,
dest: D,
keys: K,
) -> impl Future<Output = RedisResult<R>>
fn sunionstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = RedisResult<R>>
This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.