pub trait SetCommands<T>: PrepareCommand<T> {
Show 17 methods fn sadd<K, M, C>(&self, key: K, members: C) -> CommandResult<'_, T, usize>
    where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn scard<K>(&self, key: K) -> CommandResult<'_, T, usize>
    where
        K: Into<BulkString>
, { ... } fn sdiff<K, M, C, A>(&self, keys: C) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash,
        C: SingleArgOrCollection<K>,
        A: FromSingleValueArray<M>
, { ... } fn sdiffstore<D, K, C>(
        &self,
        destination: D,
        keys: C
    ) -> CommandResult<'_, T, usize>
    where
        D: Into<BulkString>,
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn sinter<K, M, C, A>(&self, keys: C) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash,
        C: SingleArgOrCollection<K>,
        A: FromSingleValueArray<M>
, { ... } fn sintercard<K, C>(
        &self,
        keys: C,
        limit: usize
    ) -> CommandResult<'_, T, usize>
    where
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn sinterstore<D, K, C>(
        &self,
        destination: D,
        keys: C
    ) -> CommandResult<'_, T, usize>
    where
        D: Into<BulkString>,
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... } fn sismember<K, M>(&self, key: K, member: M) -> CommandResult<'_, T, bool>
    where
        K: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn smembers<K, M, A>(&self, key: K) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash,
        A: FromSingleValueArray<M>
, { ... } fn smismember<K, M, C>(
        &self,
        key: K,
        members: C
    ) -> CommandResult<'_, T, Vec<bool>>
    where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn smove<S, D, M>(
        &self,
        source: S,
        destination: D,
        member: M
    ) -> CommandResult<'_, T, bool>
    where
        S: Into<BulkString>,
        D: Into<BulkString>,
        M: Into<BulkString>
, { ... } fn spop<K, M, A>(&self, key: K, count: usize) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash,
        A: FromSingleValueArray<M>
, { ... } fn srandmember<K, M, A>(
        &self,
        key: K,
        count: usize
    ) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash,
        A: FromSingleValueArray<M>
, { ... } fn srem<K, M, C>(&self, key: K, members: C) -> CommandResult<'_, T, usize>
    where
        K: Into<BulkString>,
        M: Into<BulkString>,
        C: SingleArgOrCollection<M>
, { ... } fn sscan<K, M>(
        &self,
        key: K,
        cursor: u64,
        options: SScanOptions
    ) -> CommandResult<'_, T, (u64, Vec<M>)>
    where
        K: Into<BulkString>,
        M: FromValue
, { ... } fn sunion<K, M, C, A>(&self, keys: C) -> CommandResult<'_, T, A>
    where
        K: Into<BulkString>,
        M: FromValue + Eq + Hash,
        C: SingleArgOrCollection<K>,
        A: FromSingleValueArray<M>
, { ... } fn sunionstore<D, K, C>(
        &self,
        destination: D,
        keys: C
    ) -> CommandResult<'_, T, usize>
    where
        D: Into<BulkString>,
        K: Into<BulkString>,
        C: SingleArgOrCollection<K>
, { ... }
}
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