[][src]Struct redis::LposOptions

pub struct LposOptions { /* fields omitted */ }

Options for the [LPOS] command

https://redis.io/commands/lpos

Example

use redis::{Commands, RedisResult, LposOptions};
fn fetch_list_position(
    con: &mut redis::Connection,
    key: &str,
    value: &str,
    count: usize,
    rank: isize,
    maxlen: usize,
) -> RedisResult<Vec<usize>> {
    let opts = LposOptions::default()
        .count(count)
        .rank(rank)
        .maxlen(maxlen);
    con.lpos(key, value, opts)
}

Implementations

impl LposOptions[src]

pub fn count(self, n: usize) -> Self[src]

Limit the results to the first N matching items.

pub fn rank(self, n: isize) -> Self[src]

Return the value of N from the matching items.

pub fn maxlen(self, n: usize) -> Self[src]

Limit the search to N items in the list.

Trait Implementations

impl Default for LposOptions[src]

impl ToRedisArgs for LposOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,