Trait fred::interfaces::ListInterface

source ·
pub trait ListInterface: ClientLike + Sized {
Show 24 methods // Provided methods fn blmpop<R, K>( &self, timeout: f64, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<MultipleKeys> { ... } fn blpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<MultipleKeys> { ... } fn brpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<MultipleKeys> { ... } fn brpoplpush<R, S, D>( &self, source: S, destination: D, timeout: f64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey> { ... } fn blmove<R, S, D>( &self, source: S, destination: D, source_direction: LMoveDirection, destination_direction: LMoveDirection, timeout: f64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey> { ... } fn lmpop<R, K>( &self, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<MultipleKeys> { ... } fn lindex<R, K>( &self, key: K, index: i64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn linsert<R, K, P, V>( &self, key: K, location: ListLocation, pivot: P, element: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, P: TryInto<RedisValue>, P::Error: Into<RedisError>, V: TryInto<RedisValue>, V::Error: Into<RedisError> { ... } fn llen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn lpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn lpos<R, K, V>( &self, key: K, element: V, rank: Option<i64>, count: Option<i64>, maxlen: Option<i64>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<RedisValue>, V::Error: Into<RedisError> { ... } fn lpush<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<MultipleValues>, V::Error: Into<RedisError> { ... } fn lpushx<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<MultipleValues>, V::Error: Into<RedisError> { ... } fn lrange<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn lrem<R, K, V>( &self, key: K, count: i64, element: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<RedisValue>, V::Error: Into<RedisError> { ... } fn lset<R, K, V>( &self, key: K, index: i64, element: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<RedisValue>, V::Error: Into<RedisError> { ... } fn ltrim<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn rpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn rpoplpush<R, S, D>( &self, source: S, dest: D, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey> { ... } fn lmove<R, S, D>( &self, source: S, dest: D, source_direction: LMoveDirection, dest_direction: LMoveDirection, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey> { ... } fn rpush<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<MultipleValues>, V::Error: Into<RedisError> { ... } fn rpushx<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, V: TryInto<MultipleValues>, V::Error: Into<RedisError> { ... } fn sort<R, K, S>( &self, key: K, by: Option<Str>, limit: Option<Limit>, get: S, order: Option<SortOrder>, alpha: bool, store: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, S: Into<MultipleStrings> { ... } fn sort_ro<R, K, S>( &self, key: K, by: Option<Str>, limit: Option<Limit>, get: S, order: Option<SortOrder>, alpha: bool, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey>, S: Into<MultipleStrings> { ... }
}
Available on crate feature i-lists only.
Expand description

Functions that implement the lists interface.

Provided Methods§

source

fn blmpop<R, K>( &self, timeout: f64, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

source

fn blpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

BLPOP is a blocking list pop primitive. It is the blocking version of LPOP because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.

https://redis.io/commands/blpop

source

fn brpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

BRPOP is a blocking list pop primitive. It is the blocking version of RPOP because it blocks the connection when there are no elements to pop from any of the given lists. An element is popped from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given.

https://redis.io/commands/brpop

source

fn brpoplpush<R, S, D>( &self, source: S, destination: D, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

source

fn blmove<R, S, D>( &self, source: S, destination: D, source_direction: LMoveDirection, destination_direction: LMoveDirection, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

The blocking equivalent of Self::lmove.

https://redis.io/commands/blmove

source

fn lmpop<R, K>( &self, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

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

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

source

fn lindex<R, K>( &self, key: K, index: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

https://redis.io/commands/lindex

source

fn linsert<R, K, P, V>( &self, key: K, location: ListLocation, pivot: P, element: V, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/linsert

source

fn llen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Returns the length of the list stored at key.

https://redis.io/commands/llen

source

fn lpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

https://redis.io/commands/lpop

source

fn lpos<R, K, V>( &self, key: K, element: V, rank: Option<i64>, count: Option<i64>, maxlen: Option<i64>, ) -> impl Future<Output = RedisResult<R>>

The command returns the index of matching elements inside a Redis list.

https://redis.io/commands/lpos

source

fn lpush<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/lpush

source

fn lpushx<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/lpushx

source

fn lrange<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

Returns the specified elements of the list stored at key.

https://redis.io/commands/lrange

source

fn lrem<R, K, V>( &self, key: K, count: i64, element: V, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/lrem

source

fn lset<R, K, V>( &self, key: K, index: i64, element: V, ) -> impl Future<Output = RedisResult<R>>

Sets the list element at index to element.

https://redis.io/commands/lset

source

fn ltrim<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

https://redis.io/commands/ltrim

source

fn rpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

https://redis.io/commands/rpop

source

fn rpoplpush<R, S, D>( &self, source: S, dest: D, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

https://redis.io/commands/rpoplpush

source

fn lmove<R, S, D>( &self, source: S, dest: D, source_direction: LMoveDirection, dest_direction: LMoveDirection, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisKey>, D: Into<RedisKey>,

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

https://redis.io/commands/lmove

source

fn rpush<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/rpush

source

fn rpushx<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/rpushx

source

fn sort<R, K, S>( &self, key: K, by: Option<Str>, limit: Option<Limit>, get: S, order: Option<SortOrder>, alpha: bool, store: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>>

Returns or stores the elements contained in the list, set or sorted set at key.

https://redis.io/commands/sort/

source

fn sort_ro<R, K, S>( &self, key: K, by: Option<Str>, limit: Option<Limit>, get: S, order: Option<SortOrder>, alpha: bool, ) -> impl Future<Output = RedisResult<R>>

Read-only variant of the SORT command. It is exactly like the original SORT but refuses the STORE option and can safely be used in read-only replicas.

https://redis.io/commands/sort_ro/

Object Safety§

This trait is not object safe.

Implementors§