Trait rustis::commands::ListCommands

source ·
pub trait ListCommands<'a> {
Show 17 methods // Provided methods fn lindex<K, E>(self, key: K, index: isize) -> PreparedCommand<'a, Self, E> where Self: Sized, K: SingleArg, E: PrimitiveResponse { ... } fn linsert<K, E>( self, key: K, where_: LInsertWhere, pivot: E, element: E ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, E: SingleArg { ... } fn llen<K>(self, key: K) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg { ... } fn lmove<S, D, E>( self, source: S, destination: D, where_from: LMoveWhere, where_to: LMoveWhere ) -> PreparedCommand<'a, Self, E> where Self: Sized, S: SingleArg, D: SingleArg, E: PrimitiveResponse { ... } fn lmpop<K, E, C>( self, keys: C, where_: LMoveWhere, count: usize ) -> PreparedCommand<'a, Self, (String, Vec<E>)> where Self: Sized, K: SingleArg, E: PrimitiveResponse + DeserializeOwned, C: SingleArgCollection<K> { ... } fn lpop<K, E, A>(self, key: K, count: usize) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, E: PrimitiveResponse + DeserializeOwned, A: CollectionResponse<E> + DeserializeOwned { ... } fn lpos<K, E>( self, key: K, element: E, rank: Option<usize>, max_len: Option<usize> ) -> PreparedCommand<'a, Self, Option<usize>> where Self: Sized, K: SingleArg, E: SingleArg { ... } fn lpos_with_count<K, E, A>( self, key: K, element: E, num_matches: usize, rank: Option<usize>, max_len: Option<usize> ) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, E: SingleArg, A: CollectionResponse<usize> { ... } fn lpush<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E> { ... } fn lpushx<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E> { ... } fn lrange<K, E, A>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, A> where Self: Sized, K: SingleArg, E: PrimitiveResponse + DeserializeOwned, A: CollectionResponse<E> + DeserializeOwned { ... } fn lrem<K, E>( self, key: K, count: isize, element: E ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, E: SingleArg { ... } fn lset<K, E>( self, key: K, index: isize, element: E ) -> PreparedCommand<'a, Self, ()> where Self: Sized, K: SingleArg, E: SingleArg { ... } fn ltrim<K>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, ()> where Self: Sized, K: SingleArg { ... } fn rpop<K, E, C>(self, key: K, count: usize) -> PreparedCommand<'a, Self, C> where Self: Sized, K: SingleArg, E: PrimitiveResponse + DeserializeOwned, C: CollectionResponse<E> + DeserializeOwned { ... } fn rpush<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E> { ... } fn rpushx<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E> { ... }
}
Expand description

A group of Redis commands related to Lists

§See Also

Redis List Commands

Provided Methods§

source

fn lindex<K, E>(self, key: K, index: isize) -> PreparedCommand<'a, Self, E>
where Self: Sized, K: SingleArg, E: PrimitiveResponse,

Returns the element at index index in the list stored at key.

§Return

The requested element, or nil when index is out of range.

§See Also

https://redis.io/commands/lindex/

source

fn linsert<K, E>( self, key: K, where_: LInsertWhere, pivot: E, element: E ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg,

Inserts element in the list stored at key either before or after the reference value pivot.

§Return

The length of the list after the insert operation, or -1 when the value pivot was not found.

§See Also

https://redis.io/commands/linsert/

source

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

Inserts element in the list stored at key either before or after the reference value pivot.

§Return

The length of the list at key.

§See Also

https://redis.io/commands/llen/

source

fn lmove<S, D, E>( self, source: S, destination: D, where_from: LMoveWhere, where_to: LMoveWhere ) -> PreparedCommand<'a, Self, E>
where Self: Sized, S: SingleArg, D: SingleArg, E: PrimitiveResponse,

Atomically returns and removes the first/last element (head/tail depending on the wherefrom argument) of the list stored at source, and pushes the element at the first/last element (head/tail depending on the whereto argument) of the list stored at destination.

§Return

The element being popped and pushed.

§See Also

https://redis.io/commands/lmove/

source

fn lmpop<K, E, C>( self, keys: C, where_: LMoveWhere, count: usize ) -> PreparedCommand<'a, Self, (String, Vec<E>)>

Pops one or more elements from the first non-empty list key from the list of provided key names.

§Return

Tuple composed by the name of the key from which elements were popped and the list of popped element

§See Also

https://redis.io/commands/lmpop/

source

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

Removes and returns the first elements of the list stored at key.

§Return

The list of popped elements, or empty collection when key does not exist.

§See Also

https://redis.io/commands/lpop/

source

fn lpos<K, E>( self, key: K, element: E, rank: Option<usize>, max_len: Option<usize> ) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized, K: SingleArg, E: SingleArg,

Returns the index of matching elements inside a Redis list.

§Return

The integer representing the matching element, or nil if there is no match.

§See Also

https://redis.io/commands/lpos/

source

fn lpos_with_count<K, E, A>( self, key: K, element: E, num_matches: usize, rank: Option<usize>, max_len: Option<usize> ) -> PreparedCommand<'a, Self, A>

Returns the index of matching elements inside a Redis list.

§Return

An array of integers representing the matching elements. (empty if there are no matches).

§See Also

https://redis.io/commands/lpos/

source

fn lpush<K, E, C>(self, key: K, elements: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

Insert all the specified values at the head of the list stored at key

§Return

The length of the list after the push operations.

§See Also

https://redis.io/commands/lpush/

source

fn lpushx<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

Inserts specified values at the head of the list stored at key, only if key already exists and holds a list.

§Return

The length of the list after the push operation.

§See Also

https://redis.io/commands/lpushx/

source

fn lrange<K, E, A>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, A>

Returns the specified elements of the list stored at key.

§Return

The list of elements in the specified range.

§See Also

https://redis.io/commands/lrange/

source

fn lrem<K, E>( self, key: K, count: isize, element: E ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg,

Removes the first count occurrences of elements equal to element from the list stored at key.

§Return

The number of removed elements.

§See Also

https://redis.io/commands/lrem/

source

fn lset<K, E>( self, key: K, index: isize, element: E ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, E: SingleArg,

Sets the list element at index to element.

§See Also

https://redis.io/commands/lset/

source

fn ltrim<K>( self, key: K, start: isize, stop: isize ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg,

Trim an existing list so that it will contain only the specified range of elements specified.

§See Also

https://redis.io/commands/ltrim/

source

fn rpop<K, E, C>(self, key: K, count: usize) -> PreparedCommand<'a, Self, C>

Removes and returns the first elements of the list stored at key.

§Return

The list of popped elements, or empty collection when key does not exist.

§See Also

https://redis.io/commands/rpop/

source

fn rpush<K, E, C>(self, key: K, elements: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

Insert all the specified values at the tail of the list stored at key

§Return

The length of the list after the push operations.

§See Also

https://redis.io/commands/rpush/

source

fn rpushx<K, E, C>( self, key: K, elements: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, E: SingleArg, C: SingleArgCollection<E>,

Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list.

§Return

The length of the list after the push operations.

§See Also

https://redis.io/commands/rpushx/

Implementors§

source§

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

source§

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

source§

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