[][src]Trait redis_ts::AsyncTsCommands

pub trait AsyncTsCommands: ConnectionLike + Send + Sized {
    fn ts_info<'a, K: ToRedisArgs + Send + Sync + 'a>(
        &'a mut self,
        key: K
    ) -> RedisFuture<TsInfo> { ... }
fn ts_create<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        options: TsOptions
    ) -> RedisFuture<RV> { ... }
fn ts_add<'a, K: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        ts: TS,
        value: V
    ) -> RedisFuture<RV> { ... }
fn ts_add_now<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        value: V
    ) -> RedisFuture<RV> { ... }
fn ts_add_create<'a, K: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        ts: TS,
        value: V,
        options: TsOptions
    ) -> RedisFuture<RV> { ... }
fn ts_madd<'a, K: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        values: &'a [(K, TS, V)]
    ) -> RedisFuture<RV> { ... }
fn ts_incrby_now<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        value: V
    ) -> RedisFuture<RV> { ... }
fn ts_incrby<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        ts: TS,
        value: V
    ) -> RedisFuture<RV> { ... }
fn ts_incrby_create<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        ts: TS,
        value: V,
        options: TsOptions
    ) -> RedisFuture<RV> { ... }
fn ts_decrby_now<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        value: V
    ) -> RedisFuture<RV> { ... }
fn ts_decrby<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        ts: TS,
        value: V
    ) -> RedisFuture<RV> { ... }
fn ts_decrby_create<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        key: K,
        ts: TS,
        value: V,
        options: TsOptions
    ) -> RedisFuture<RV> { ... }
fn ts_createrule<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        source_key: K,
        dest_key: K,
        aggregation_type: TsAggregationType
    ) -> RedisFuture<RV> { ... }
fn ts_deleterule<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
        &'a mut self,
        source_key: K,
        dest_key: K
    ) -> RedisFuture<RV> { ... }
fn ts_get<'a, K: ToRedisArgs + Send + Sync + 'a, TS: FromRedisValue, V: FromRedisValue>(
        &'a mut self,
        key: K
    ) -> RedisFuture<Option<(TS, V)>> { ... }
fn ts_mget<'a, TS: Default + FromRedisValue, V: Default + FromRedisValue>(
        &'a mut self,
        filter_options: TsFilterOptions
    ) -> RedisFuture<TsMget<TS, V>> { ... }
fn ts_range<'a, K: ToRedisArgs + Send + Sync + 'a, FTS: ToRedisArgs + Send + Sync + 'a, TTS: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, TS: Copy + FromRedisValue, V: Copy + FromRedisValue>(
        &'a mut self,
        key: K,
        from_timestamp: FTS,
        to_timestamp: TTS,
        count: Option<C>,
        aggregation_type: Option<TsAggregationType>
    ) -> RedisFuture<TsRange<TS, V>> { ... }
fn ts_mrange<'a, FTS: ToRedisArgs + Send + Sync + 'a, TTS: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>(
        &mut self,
        from_timestamp: FTS,
        to_timestamp: TTS,
        count: Option<C>,
        aggregation_type: Option<TsAggregationType>,
        filter_options: TsFilterOptions
    ) -> RedisFuture<TsMrange<TS, V>> { ... }
fn ts_queryindex<'a>(
        &'a mut self,
        filter_options: TsFilterOptions
    ) -> RedisFuture<Vec<String>> { ... } }

Provides a high level synchronous API to work with redis time series data types. Uses some abstractions for easier handling of time series related redis command arguments. All commands are directly available on ConnectionLike types from the redis crate.

use redis::AsyncCommands;
use redis_ts::{AsyncTsCommands, TsOptions};
 
let client = redis::Client::open("redis://127.0.0.1/")?;
let mut con = client.get_async_connection().await?;
 
let _:() = con.ts_create("my_ts", TsOptions::default()).await?;
let ts:u64 = con.ts_add_now("my_ts", 2.0).await?;
let v:Option<(u64,f64)> = con.ts_get("my_ts").await?;

Provided methods

fn ts_info<'a, K: ToRedisArgs + Send + Sync + 'a>(
    &'a mut self,
    key: K
) -> RedisFuture<TsInfo>

Returns information about a redis time series key.

fn ts_create<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    options: TsOptions
) -> RedisFuture<RV>

Creates a new redis time series key.

fn ts_add<'a, K: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    ts: TS,
    value: V
) -> RedisFuture<RV>

Adds a single time series value with a timestamp to an existing redis time series.

fn ts_add_now<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    value: V
) -> RedisFuture<RV>

Adds a single time series value to an existing redis time series with redis system time as timestamp.

fn ts_add_create<'a, K: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    ts: TS,
    value: V,
    options: TsOptions
) -> RedisFuture<RV>

Adds a single time series value to a redis time series. If the time series does not yet exist it will be created with given settings.

fn ts_madd<'a, K: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    values: &'a [(K, TS, V)]
) -> RedisFuture<RV>

Adds multiple time series values to an existing redis time series.

fn ts_incrby_now<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    value: V
) -> RedisFuture<RV>

Increments a time series value with redis system time.

fn ts_incrby<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    ts: TS,
    value: V
) -> RedisFuture<RV>

Increments a time series value with given timestamp.

fn ts_incrby_create<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    ts: TS,
    value: V,
    options: TsOptions
) -> RedisFuture<RV>

Increments a time series value with timestamp. Time series will be created if it not already exists.

fn ts_decrby_now<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    value: V
) -> RedisFuture<RV>

Decrements a time series value with redis system time.

fn ts_decrby<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    ts: TS,
    value: V
) -> RedisFuture<RV>

Decrements a time series value with given timestamp.

fn ts_decrby_create<'a, K: ToRedisArgs + Send + Sync + 'a, V: ToRedisArgs + Send + Sync + 'a, TS: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    key: K,
    ts: TS,
    value: V,
    options: TsOptions
) -> RedisFuture<RV>

Decrements a time series value with timestamp. Time series will be created if it not already exists.

fn ts_createrule<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    source_key: K,
    dest_key: K,
    aggregation_type: TsAggregationType
) -> RedisFuture<RV>

Creates a new redis time series compaction rule.

fn ts_deleterule<'a, K: ToRedisArgs + Send + Sync + 'a, RV: FromRedisValue>(
    &'a mut self,
    source_key: K,
    dest_key: K
) -> RedisFuture<RV>

Deletes an existing redis time series compaction rule.

fn ts_get<'a, K: ToRedisArgs + Send + Sync + 'a, TS: FromRedisValue, V: FromRedisValue>(
    &'a mut self,
    key: K
) -> RedisFuture<Option<(TS, V)>>

Returns the latest (current) value in a redis time series.

fn ts_mget<'a, TS: Default + FromRedisValue, V: Default + FromRedisValue>(
    &'a mut self,
    filter_options: TsFilterOptions
) -> RedisFuture<TsMget<TS, V>>

Returns the latest (current) value from multiple redis time series.

fn ts_range<'a, K: ToRedisArgs + Send + Sync + 'a, FTS: ToRedisArgs + Send + Sync + 'a, TTS: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, TS: Copy + FromRedisValue, V: Copy + FromRedisValue>(
    &'a mut self,
    key: K,
    from_timestamp: FTS,
    to_timestamp: TTS,
    count: Option<C>,
    aggregation_type: Option<TsAggregationType>
) -> RedisFuture<TsRange<TS, V>>

Executes a redis time series range query.

fn ts_mrange<'a, FTS: ToRedisArgs + Send + Sync + 'a, TTS: ToRedisArgs + Send + Sync + 'a, C: ToRedisArgs + Send + Sync + 'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>(
    &mut self,
    from_timestamp: FTS,
    to_timestamp: TTS,
    count: Option<C>,
    aggregation_type: Option<TsAggregationType>,
    filter_options: TsFilterOptions
) -> RedisFuture<TsMrange<TS, V>>

Executes multiple redis time series range queries.

fn ts_queryindex<'a>(
    &'a mut self,
    filter_options: TsFilterOptions
) -> RedisFuture<Vec<String>>

Returns a filtered list of redis time series keys.

Loading content...

Implementors

impl<T> AsyncTsCommands for T where
    T: Send + ConnectionLike
[src]

Loading content...