Trait redis_driver::ListCommands
source · [−]pub trait ListCommands<T>: PrepareCommand<T> {
Show 21 methods
fn blmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere,
timeout: f64
) -> CommandResult<'_, T, E>
where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
{ ... }
fn blmpop<K, E, C>(
&self,
timeout: f64,
keys: C,
where_: LMoveWhere,
count: usize
) -> CommandResult<'_, T, Option<(String, Vec<E>)>>
where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
{ ... }
fn blpop<K, KK, K1, V>(
&self,
keys: KK,
timeout: f64
) -> CommandResult<'_, T, Option<(K1, V)>>
where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
K1: FromValue,
V: FromValue,
{ ... }
fn brpop<K, KK, K1, V>(
&self,
keys: KK,
timeout: f64
) -> CommandResult<'_, T, Option<(K1, V)>>
where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
K1: FromValue,
V: FromValue,
{ ... }
fn lindex<K, E>(&self, key: K, index: isize) -> CommandResult<'_, T, E>
where
K: Into<BulkString>,
E: FromValue,
{ ... }
fn linsert<K, E>(
&self,
key: K,
where_: LInsertWhere,
pivot: E,
element: E
) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
E: Into<BulkString>,
{ ... }
fn llen<K>(&self, key: K) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
{ ... }
fn lmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere
) -> CommandResult<'_, T, E>
where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
{ ... }
fn lmpop<K, E, C>(
&self,
keys: C,
where_: LMoveWhere,
count: usize
) -> CommandResult<'_, T, (String, Vec<E>)>
where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
{ ... }
fn lpop<K, E, A>(&self, key: K, count: usize) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
{ ... }
fn lpos<K, E>(
&self,
key: K,
element: E,
rank: Option<usize>,
max_len: Option<usize>
) -> CommandResult<'_, T, Option<usize>>
where
K: Into<BulkString>,
E: Into<BulkString>,
{ ... }
fn lpos_with_count<K, E, A>(
&self,
key: K,
element: E,
num_matches: usize,
rank: Option<usize>,
max_len: Option<usize>
) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
E: Into<BulkString>,
A: FromSingleValueArray<usize>,
{ ... }
fn lpush<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
{ ... }
fn lpushx<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
{ ... }
fn lrange<K, E, A>(
&self,
key: K,
start: isize,
stop: isize
) -> CommandResult<'_, T, A>
where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
{ ... }
fn lrem<K, E>(
&self,
key: K,
count: isize,
element: E
) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
E: Into<BulkString>,
{ ... }
fn lset<K, E>(
&self,
key: K,
index: isize,
element: E
) -> CommandResult<'_, T, ()>
where
K: Into<BulkString>,
E: Into<BulkString>,
{ ... }
fn ltrim<K>(
&self,
key: K,
start: isize,
stop: isize
) -> CommandResult<'_, T, ()>
where
K: Into<BulkString>,
{ ... }
fn rpop<K, E, C>(&self, key: K, count: usize) -> CommandResult<'_, T, C>
where
K: Into<BulkString>,
E: FromValue,
C: FromSingleValueArray<E>,
{ ... }
fn rpush<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
{ ... }
fn rpushx<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>
where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
{ ... }
}
Expand description
Provided Methods
sourcefn blmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere,
timeout: f64
) -> CommandResult<'_, T, E>where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
fn blmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere,
timeout: f64
) -> CommandResult<'_, T, E>where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
sourcefn blmpop<K, E, C>(
&self,
timeout: f64,
keys: C,
where_: LMoveWhere,
count: usize
) -> CommandResult<'_, T, Option<(String, Vec<E>)>>where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
fn blmpop<K, E, C>(
&self,
timeout: f64,
keys: C,
where_: LMoveWhere,
count: usize
) -> CommandResult<'_, T, Option<(String, Vec<E>)>>where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
sourcefn blpop<K, KK, K1, V>(
&self,
keys: KK,
timeout: f64
) -> CommandResult<'_, T, Option<(K1, V)>>where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
K1: FromValue,
V: FromValue,
fn blpop<K, KK, K1, V>(
&self,
keys: KK,
timeout: f64
) -> CommandResult<'_, T, Option<(K1, V)>>where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
K1: FromValue,
V: FromValue,
This command 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.
Return
None
when no element could be popped and the timeout expired- a tuple with the first element being the name of the key where an element was popped and the second element being the value of the popped element.
See Also
sourcefn brpop<K, KK, K1, V>(
&self,
keys: KK,
timeout: f64
) -> CommandResult<'_, T, Option<(K1, V)>>where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
K1: FromValue,
V: FromValue,
fn brpop<K, KK, K1, V>(
&self,
keys: KK,
timeout: f64
) -> CommandResult<'_, T, Option<(K1, V)>>where
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
K1: FromValue,
V: FromValue,
This command 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.
Return
None
when no element could be popped and the timeout expired- a tuple with the first element being the name of the key where an element was popped and the second element being the value of the popped element.
See Also
sourcefn lindex<K, E>(&self, key: K, index: isize) -> CommandResult<'_, T, E>where
K: Into<BulkString>,
E: FromValue,
fn lindex<K, E>(&self, key: K, index: isize) -> CommandResult<'_, T, E>where
K: Into<BulkString>,
E: FromValue,
sourcefn linsert<K, E>(
&self,
key: K,
where_: LInsertWhere,
pivot: E,
element: E
) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
fn linsert<K, E>(
&self,
key: K,
where_: LInsertWhere,
pivot: E,
element: E
) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
sourcefn llen<K>(&self, key: K) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
fn llen<K>(&self, key: K) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
sourcefn lmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere
) -> CommandResult<'_, T, E>where
S: Into<BulkString>,
D: Into<BulkString>,
E: FromValue,
fn lmove<S, D, E>(
&self,
source: S,
destination: D,
where_from: LMoveWhere,
where_to: LMoveWhere
) -> CommandResult<'_, T, E>where
S: Into<BulkString>,
D: Into<BulkString>,
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
sourcefn lmpop<K, E, C>(
&self,
keys: C,
where_: LMoveWhere,
count: usize
) -> CommandResult<'_, T, (String, Vec<E>)>where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
fn lmpop<K, E, C>(
&self,
keys: C,
where_: LMoveWhere,
count: usize
) -> CommandResult<'_, T, (String, Vec<E>)>where
K: Into<BulkString>,
E: FromValue,
C: SingleArgOrCollection<K>,
sourcefn lpop<K, E, A>(&self, key: K, count: usize) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
fn lpop<K, E, A>(&self, key: K, count: usize) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
sourcefn lpos<K, E>(
&self,
key: K,
element: E,
rank: Option<usize>,
max_len: Option<usize>
) -> CommandResult<'_, T, Option<usize>>where
K: Into<BulkString>,
E: Into<BulkString>,
fn lpos<K, E>(
&self,
key: K,
element: E,
rank: Option<usize>,
max_len: Option<usize>
) -> CommandResult<'_, T, Option<usize>>where
K: Into<BulkString>,
E: Into<BulkString>,
sourcefn lpos_with_count<K, E, A>(
&self,
key: K,
element: E,
num_matches: usize,
rank: Option<usize>,
max_len: Option<usize>
) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
E: Into<BulkString>,
A: FromSingleValueArray<usize>,
fn lpos_with_count<K, E, A>(
&self,
key: K,
element: E,
num_matches: usize,
rank: Option<usize>,
max_len: Option<usize>
) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
E: Into<BulkString>,
A: FromSingleValueArray<usize>,
sourcefn lpush<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
fn lpush<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
sourcefn lpushx<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
fn lpushx<K, E, C>(&self, key: K, elements: C) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
C: SingleArgOrCollection<E>,
sourcefn lrange<K, E, A>(
&self,
key: K,
start: isize,
stop: isize
) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
fn lrange<K, E, A>(
&self,
key: K,
start: isize,
stop: isize
) -> CommandResult<'_, T, A>where
K: Into<BulkString>,
E: FromValue,
A: FromSingleValueArray<E>,
sourcefn lrem<K, E>(
&self,
key: K,
count: isize,
element: E
) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
fn lrem<K, E>(
&self,
key: K,
count: isize,
element: E
) -> CommandResult<'_, T, usize>where
K: Into<BulkString>,
E: Into<BulkString>,
sourcefn lset<K, E>(&self, key: K, index: isize, element: E) -> CommandResult<'_, T, ()>where
K: Into<BulkString>,
E: Into<BulkString>,
fn lset<K, E>(&self, key: K, index: isize, element: E) -> CommandResult<'_, T, ()>where
K: Into<BulkString>,
E: Into<BulkString>,
sourcefn ltrim<K>(&self, key: K, start: isize, stop: isize) -> CommandResult<'_, T, ()>where
K: Into<BulkString>,
fn ltrim<K>(&self, key: K, start: isize, stop: isize) -> CommandResult<'_, T, ()>where
K: Into<BulkString>,
Trim an existing list so that it will contain only the specified range of elements specified.