SetsInterface

Trait 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 = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send, V: TryInto<MultipleValues> + Send, V::Error: Into<Error> + Send { ... } fn scard<R, K>(&self, key: K) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send { ... } fn sdiff<R, K>(&self, keys: K) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<MultipleKeys> + Send { ... } fn sdiffstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, D: Into<Key> + Send, K: Into<MultipleKeys> + Send { ... } fn sinter<R, K>( &self, keys: K, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<MultipleKeys> + Send { ... } fn sinterstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, D: Into<Key> + Send, K: Into<MultipleKeys> + Send { ... } fn sismember<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send { ... } fn smismember<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send, V: TryInto<MultipleValues> + Send, V::Error: Into<Error> + Send { ... } fn smembers<R, K>( &self, key: K, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send { ... } fn smove<R, S, D, V>( &self, source: S, dest: D, member: V, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<Key> + Send, D: Into<Key> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send { ... } fn spop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send { ... } fn srandmember<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send { ... } fn srem<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<Key> + Send, V: TryInto<MultipleValues> + Send, V::Error: Into<Error> + Send { ... } fn sunion<R, K>( &self, keys: K, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, K: Into<MultipleKeys> + Send { ... } fn sunionstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, D: Into<Key> + Send, K: Into<MultipleKeys> + Send { ... }
}
Available on crate feature i-sets only.
Expand description

Functions that implement the sets interface.

Provided Methods§

Source

fn sadd<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send, V: TryInto<MultipleValues> + Send, V::Error: Into<Error> + Send,

Add the specified members to the set stored at key.

https://redis.io/commands/sadd

Source

fn scard<R, K>(&self, key: K) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send,

Returns the set cardinality (number of elements) of the set stored at key.

https://redis.io/commands/scard

Source

fn sdiff<R, K>(&self, keys: K) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<MultipleKeys> + Send,

Returns the members of the set resulting from the difference between the first set and all the successive sets.

https://redis.io/commands/sdiff

Source

fn sdiffstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, D: Into<Key> + Send, K: Into<MultipleKeys> + Send,

This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

https://redis.io/commands/sdiffstore

Source

fn sinter<R, K>(&self, keys: K) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<MultipleKeys> + Send,

Returns the members of the set resulting from the intersection of all the given sets.

https://redis.io/commands/sinter

Source

fn sinterstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, D: Into<Key> + Send, K: Into<MultipleKeys> + Send,

This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

https://redis.io/commands/sinterstore

Source

fn sismember<R, K, V>( &self, key: K, member: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send,

Returns if member is a member of the set stored at key.

https://redis.io/commands/sismember

Source

fn smismember<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send, V: TryInto<MultipleValues> + Send, V::Error: Into<Error> + Send,

Returns whether each member is a member of the set stored at key.

https://redis.io/commands/smismember

Source

fn smembers<R, K>(&self, key: K) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send,

Returns all the members of the set value stored at key.

https://redis.io/commands/smembers

Source

fn smove<R, S, D, V>( &self, source: S, dest: D, member: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, S: Into<Key> + Send, D: Into<Key> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send,

Move member from the set at source to the set at destination.

https://redis.io/commands/smove

Source

fn spop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send,

Removes and returns one or more random members from the set value store at key.

https://redis.io/commands/spop

Source

fn srandmember<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send,

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.

https://redis.io/commands/srandmember

Source

fn srem<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<Key> + Send, V: TryInto<MultipleValues> + Send, V::Error: Into<Error> + Send,

Remove the specified members from the set stored at key.

https://redis.io/commands/srem

Source

fn sunion<R, K>(&self, keys: K) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, K: Into<MultipleKeys> + Send,

Returns the members of the set resulting from the union of all the given sets.

https://redis.io/commands/sunion

Source

fn sunionstore<R, D, K>( &self, dest: D, keys: K, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, D: Into<Key> + Send, K: Into<MultipleKeys> + Send,

This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

https://redis.io/commands/sunionstore

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§