pub trait AsyncTsCommands: ConnectionLike + Send + Sized {
Show 22 methods // Provided methods 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_alter<'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 + 'a, V: Default + FromRedisValue + 'a>( &mut self, filter_options: TsFilterOptions ) -> RedisFuture<'_, TsMget<TS, V>> { ... } fn ts_range<'a, K: ToRedisArgs + Send + Sync + 'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &'a mut self, key: K, query: TsRangeQuery ) -> RedisFuture<'_, TsRange<TS, V>> { ... } fn ts_revrange<'a, K: ToRedisArgs + Send + Sync + 'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &'a mut self, key: K, query: TsRangeQuery ) -> RedisFuture<'_, TsRange<TS, V>> { ... } fn ts_mrange<'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &mut self, query: TsRangeQuery, filter_options: TsFilterOptions ) -> RedisFuture<'_, TsMrange<TS, V>> { ... } fn ts_mrevrange<'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &mut self, query: TsRangeQuery, filter_options: TsFilterOptions ) -> RedisFuture<'_, TsMrange<TS, V>> { ... } fn ts_queryindex( &mut self, filter_options: TsFilterOptions ) -> RedisFuture<'_, Vec<String>> { ... }
}
Expand description

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§

source

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

Returns information about a redis time series key.

source

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.

source

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

Modifies an existing redis time series configuration.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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

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

source

fn ts_range<'a, K: ToRedisArgs + Send + Sync + 'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &'a mut self, key: K, query: TsRangeQuery ) -> RedisFuture<'_, TsRange<TS, V>>

Executes a redis time series range query.

source

fn ts_revrange<'a, K: ToRedisArgs + Send + Sync + 'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &'a mut self, key: K, query: TsRangeQuery ) -> RedisFuture<'_, TsRange<TS, V>>

Executes a redis time series revrange query.

source

fn ts_mrange<'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &mut self, query: TsRangeQuery, filter_options: TsFilterOptions ) -> RedisFuture<'_, TsMrange<TS, V>>

Executes multiple redis time series range queries.

source

fn ts_mrevrange<'a, TS: Default + FromRedisValue + Copy, V: Default + FromRedisValue + Copy>( &mut self, query: TsRangeQuery, filter_options: TsFilterOptions ) -> RedisFuture<'_, TsMrange<TS, V>>

Executes multiple redis time series revrange queries.

source

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

Returns a filtered list of redis time series keys.

Object Safety§

This trait is not object safe.

Implementors§