Trait SetCommands

Source
pub trait SetCommands<'a> {
Show 17 methods // Provided methods fn sadd<K, M, C>( self, key: K, members: C, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M> { ... } fn scard<K>(self, key: K) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg { ... } fn sdiff<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, M: PrimitiveResponse + Eq + Hash + DeserializeOwned, C: SingleArgCollection<K>, A: CollectionResponse<M> + DeserializeOwned { ... } fn sdiffstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K> { ... } fn sinter<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, M: PrimitiveResponse + Eq + Hash + DeserializeOwned, C: SingleArgCollection<K>, A: CollectionResponse<M> + DeserializeOwned { ... } fn sintercard<K, C>( self, keys: C, limit: usize, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, C: SingleArgCollection<K> { ... } fn sinterstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K> { ... } fn sismember<K, M>( self, key: K, member: M, ) -> PreparedCommand<'a, Self, bool> where Self: Sized, K: SingleArg, M: SingleArg { ... } fn smembers<K, M, A>(self, key: K) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, M: PrimitiveResponse + Eq + Hash + DeserializeOwned, A: CollectionResponse<M> + DeserializeOwned { ... } fn smismember<K, M, C>( self, key: K, members: C, ) -> PreparedCommand<'a, Self, Vec<bool>> where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M> { ... } fn smove<S, D, M>( self, source: S, destination: D, member: M, ) -> PreparedCommand<'a, Self, bool> where Self: Sized, S: SingleArg, D: SingleArg, M: SingleArg { ... } fn spop<K, M, A>(self, key: K, count: usize) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, M: PrimitiveResponse + Eq + Hash + DeserializeOwned, A: CollectionResponse<M> + DeserializeOwned { ... } fn srandmember<K, M, A>( self, key: K, count: usize, ) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, M: PrimitiveResponse + Eq + Hash + DeserializeOwned, A: CollectionResponse<M> + DeserializeOwned { ... } fn srem<K, M, C>( self, key: K, members: C, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M> { ... } fn sscan<K, M>( self, key: K, cursor: u64, options: SScanOptions, ) -> PreparedCommand<'a, Self, (u64, Vec<M>)> where Self: Sized, K: SingleArg, M: PrimitiveResponse + DeserializeOwned { ... } fn sunion<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, M: PrimitiveResponse + Eq + Hash + DeserializeOwned, C: SingleArgCollection<K>, A: CollectionResponse<M> + DeserializeOwned { ... } fn sunionstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K> { ... }
}
Expand description

A group of Redis commands related to Sets

§See Also

Redis Set Commands

Provided Methods§

Source

fn sadd<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

Add the specified members to the set stored at key.

§See Also

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

Source

fn scard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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/

Source

fn sdiff<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A>

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/

Source

fn sdiffstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

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/

Source

fn sinter<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A>

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/

Source

fn sintercard<K, C>( self, keys: C, limit: usize, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, C: SingleArgCollection<K>,

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/

Source

fn sinterstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

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/

Source

fn sismember<K, M>(self, key: K, member: M) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, M: SingleArg,

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/

Source

fn smembers<K, M, A>(self, key: K) -> PreparedCommand<'a, Self, A>

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

§See Also

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

Source

fn smismember<K, M, C>( self, key: K, members: C, ) -> PreparedCommand<'a, Self, Vec<bool>>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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/

Source

fn smove<S, D, M>( self, source: S, destination: D, member: M, ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, S: SingleArg, D: SingleArg, M: SingleArg,

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/

Source

fn spop<K, M, A>(self, key: K, count: usize) -> PreparedCommand<'a, Self, A>

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/

Source

fn srandmember<K, M, A>( self, key: K, count: usize, ) -> PreparedCommand<'a, Self, A>

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/

Source

fn srem<K, M, C>(self, key: K, members: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, M: SingleArg, C: SingleArgCollection<M>,

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/

Source

fn sscan<K, M>( self, key: K, cursor: u64, options: SScanOptions, ) -> PreparedCommand<'a, Self, (u64, Vec<M>)>

Iterates elements of Sets types.

§Return

a list of Set members.

§See Also

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

Source

fn sunion<K, M, C, A>(self, keys: C) -> PreparedCommand<'a, Self, A>

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/

Source

fn sunionstore<D, K, C>( self, destination: D, keys: C, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, C: SingleArgCollection<K>,

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§

Source§

impl<'a> SetCommands<'a> for &'a Client

Source§

impl<'a> SetCommands<'a> for &'a mut Transaction

Source§

impl<'a, 'b> SetCommands<'a> for &'a mut Pipeline<'b>