Trait ListCommands

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

A group of Redis commands related to Lists

§See Also

Redis List Commands

Provided Methods§

Source

fn lindex<K, E>(&mut self, key: K, index: isize) -> PreparedCommand<'_, Self, E>
where Self: Sized, K: Into<CommandArg>, E: FromValue,

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>( &mut self, key: K, where_: LInsertWhere, pivot: E, element: E, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

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>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

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>( &mut self, source: S, destination: D, where_from: LMoveWhere, where_to: LMoveWhere, ) -> PreparedCommand<'_, Self, E>
where Self: Sized, S: Into<CommandArg>, D: Into<CommandArg>, E: FromValue,

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>( &mut self, keys: C, where_: LMoveWhere, count: usize, ) -> PreparedCommand<'_, Self, (String, Vec<E>)>
where Self: Sized, K: Into<CommandArg>, E: FromValue, C: SingleArgOrCollection<K>,

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>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, E: FromValue, A: FromSingleValueArray<E>,

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>( &mut self, key: K, element: E, rank: Option<usize>, max_len: Option<usize>, ) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

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>( &mut self, key: K, element: E, num_matches: usize, rank: Option<usize>, max_len: Option<usize>, ) -> PreparedCommand<'_, 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>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

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>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

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>( &mut self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, E: FromValue, A: FromSingleValueArray<E>,

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>( &mut self, key: K, count: isize, element: E, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

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>( &mut self, key: K, index: isize, element: E, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

Sets the list element at index to element.

§See Also

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

Source

fn ltrim<K>( &mut self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>,

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>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, C>
where Self: Sized, K: Into<CommandArg>, E: FromValue, C: FromSingleValueArray<E>,

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>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

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>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

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§