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> { ... }
}i-lists only.Expand description
Functions that implement the lists interface.
Provided Methods§
sourcefn blmpop<R, K>(
&self,
timeout: f64,
keys: K,
direction: LMoveDirection,
count: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
fn blmpop<R, K>( &self, timeout: f64, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
The blocking variant of Self::lmpop.
sourcefn blpop<R, K>(
&self,
keys: K,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
fn blpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
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.
sourcefn brpop<R, K>(
&self,
keys: K,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
fn brpop<R, K>( &self, keys: K, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
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.
sourcefn brpoplpush<R, S, D>(
&self,
source: S,
destination: D,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
fn brpoplpush<R, S, D>( &self, source: S, destination: D, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
The blocking equivalent of Self::rpoplpush.
sourcefn blmove<R, S, D>(
&self,
source: S,
destination: D,
source_direction: LMoveDirection,
destination_direction: LMoveDirection,
timeout: f64,
) -> impl Future<Output = RedisResult<R>>
fn blmove<R, S, D>( &self, source: S, destination: D, source_direction: LMoveDirection, destination_direction: LMoveDirection, timeout: f64, ) -> impl Future<Output = RedisResult<R>>
The blocking equivalent of Self::lmove.
sourcefn lmpop<R, K>(
&self,
keys: K,
direction: LMoveDirection,
count: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
fn lmpop<R, K>( &self, keys: K, direction: LMoveDirection, count: Option<i64>, ) -> impl Future<Output = RedisResult<R>>
Pops one or more elements from the first non-empty list key from the list of provided key names.
sourcefn lindex<R, K>(
&self,
key: K,
index: i64,
) -> impl Future<Output = RedisResult<R>>
fn lindex<R, K>( &self, key: K, index: i64, ) -> impl Future<Output = RedisResult<R>>
Returns the element at index in the list stored at key.
sourcefn 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 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>,
Inserts element in the list stored at key either before or after the reference value pivot.
sourcefn llen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
fn llen<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
Returns the length of the list stored at key.
sourcefn lpop<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
fn lpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
Removes and returns the first elements of the list stored at key.
sourcefn lpos<R, K, V>(
&self,
key: K,
element: V,
rank: Option<i64>,
count: Option<i64>,
maxlen: Option<i64>,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn lpush<R, K, V>(
&self,
key: K,
elements: V,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn lpushx<R, K, V>(
&self,
key: K,
elements: V,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn lrange<R, K>(
&self,
key: K,
start: i64,
stop: i64,
) -> impl Future<Output = RedisResult<R>>
fn lrange<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
Returns the specified elements of the list stored at key.
sourcefn lrem<R, K, V>(
&self,
key: K,
count: i64,
element: V,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn lset<R, K, V>(
&self,
key: K,
index: i64,
element: V,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn ltrim<R, K>(
&self,
key: K,
start: i64,
stop: i64,
) -> impl Future<Output = RedisResult<R>>
fn ltrim<R, K>( &self, key: K, start: i64, stop: i64, ) -> impl Future<Output = RedisResult<R>>
Trim an existing list so that it will contain only the specified range of elements specified.
sourcefn rpop<R, K>(
&self,
key: K,
count: Option<usize>,
) -> impl Future<Output = RedisResult<R>>
fn rpop<R, K>( &self, key: K, count: Option<usize>, ) -> impl Future<Output = RedisResult<R>>
Removes and returns the last elements of the list stored at key.
sourcefn rpoplpush<R, S, D>(
&self,
source: S,
dest: D,
) -> impl Future<Output = RedisResult<R>>
fn rpoplpush<R, S, D>( &self, source: S, dest: D, ) -> impl Future<Output = RedisResult<R>>
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.
sourcefn lmove<R, S, D>(
&self,
source: S,
dest: D,
source_direction: LMoveDirection,
dest_direction: LMoveDirection,
) -> impl Future<Output = RedisResult<R>>
fn lmove<R, S, D>( &self, source: S, dest: D, source_direction: LMoveDirection, dest_direction: LMoveDirection, ) -> impl Future<Output = RedisResult<R>>
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.
sourcefn rpush<R, K, V>(
&self,
key: K,
elements: V,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn rpushx<R, K, V>(
&self,
key: K,
elements: V,
) -> impl Future<Output = RedisResult<R>>
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.
sourcefn 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>>
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.
sourcefn 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>>
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.