pub trait SetCommands: CommandSend {
Show 17 methods fn sadd<K, M>(
        &self,
        key: K,
        members: M
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        M: IntoArgs
, { ... } fn scard<K>(
        &self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>
, { ... } fn sdiff<K, M>(
        &self,
        keys: K
    ) -> Pin<Box<dyn Future<Output = Result<HashSet<M>>> + '_>>
   where
        K: IntoArgs,
        M: FromValue + Eq + Hash
, { ... } fn sdiffstore<D, K>(
        &self,
        destination: D,
        keys: K
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        D: Into<BulkString>,
        K: IntoArgs
, { ... } fn sinter<K, M>(
        &self,
        keys: K
    ) -> Pin<Box<dyn Future<Output = Result<HashSet<M>>> + '_>>
   where
        K: IntoArgs,
        M: FromValue + Eq + Hash
, { ... } fn sintercard<K>(
        &self,
        keys: K,
        limit: usize
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: IntoArgs
, { ... } fn sinterstore<D, K>(
        &self,
        destination: D,
        keys: K
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        D: Into<BulkString>,
        K: IntoArgs
, { ... } fn sismember<K, M>(
        &self,
        key: K,
        member: M
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + '_>>
   where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn smembers<K, M>(
        &self,
        key: K
    ) -> Pin<Box<dyn Future<Output = Result<HashSet<M>>> + '_>>
   where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash
, { ... } fn smismember<K, M>(
        &self,
        key: K,
        members: M
    ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + '_>>
   where
        K: Into<BulkString>,
        M: IntoArgs
, { ... } fn smove<S, D, M>(
        &self,
        source: S,
        destination: D,
        member: M
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + '_>>
   where
        S: Into<BulkString>,
        D: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn spop<K, M>(
        &self,
        key: K,
        count: usize
    ) -> Pin<Box<dyn Future<Output = Result<HashSet<M>>> + '_>>
   where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash
, { ... } fn srandmember<K, M>(
        &self,
        key: K,
        count: usize
    ) -> Pin<Box<dyn Future<Output = Result<HashSet<M>>> + '_>>
   where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash
, { ... } fn srem<K, M>(
        &self,
        key: K,
        members: M
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        K: Into<BulkString>,
        M: IntoArgs
, { ... } fn sscan<K>(&self, key: K, cursor: usize) -> SScan<'_, Self>
   where
        K: Into<BulkString> + Send
, { ... } fn sunion<K, M>(
        &self,
        keys: K
    ) -> Pin<Box<dyn Future<Output = Result<HashSet<M>>> + '_>>
   where
        K: IntoArgs,
        M: FromValue + Eq + Hash
, { ... } fn sunionstore<D, K>(
        &self,
        destination: D,
        keys: K
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + '_>>
   where
        D: Into<BulkString>,
        K: IntoArgs
, { ... }
}
Expand description

A group of Redis commands related to Sets

See Also

Redis Set Commands

Provided Methods

Add the specified members to the set stored at key.

See Also

https://redis.io/commands/sadd/

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

Return

The cardinality (number of elements) of the set, or 0 if key does not exist.

See Also

https://redis.io/commands/scard/

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

Return

A list with members of the resulting set.

See Also

https://redis.io/commands/sdiff/

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

Return

The number of elements in the resulting set.

See Also

https://redis.io/commands/sdiffstore/

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

Return

A list with members of the resulting set.

See Also

https://redis.io/commands/sinter/

This command is similar to sinter, but instead of returning the result set, it returns just the cardinality of the result.

limit: if the intersection cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality. 0 means unlimited

Return

A list with members of the resulting set.

See Also

https://redis.io/commands/sintercard/

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

Return

The number of elements in the resulting set.

See Also

https://redis.io/commands/sinterstore/

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

Return

*true“ if the element is a member of the set. false if the element is not a member of the set, or if key does not exist.

See Also

https://redis.io/commands/sismember/

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

See Also

https://redis.io/commands/smembers/

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

Return

list representing the membership of the given elements, in the same order as they are requested.

See Also

https://redis.io/commands/smismember/

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

Return
  • true if the element is moved.
  • false if the element is not a member of source and no operation was performed.
See Also

https://redis.io/commands/smove/

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

Return

the list of popped elements

See Also

https://redis.io/commands/spop/

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

Return

the list of popped elements

See Also

https://redis.io/commands/srandmember/

Remove the specified members from the set stored at key.

Return

the number of members that were removed from the set, not including non existing members.

See Also

https://redis.io/commands/srem/

Iterates elements of Sets types.

Return

a list of Set members.

See Also

https://redis.io/commands/sscan/

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

Return

A list with members of the resulting set.

See Also

https://redis.io/commands/sunion/

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

Return

The number of elements in the resulting set.

See Also

https://redis.io/commands/sunionstore/

Implementors