Struct redis_ts::TsFilterOptions
source · pub struct TsFilterOptions { /* private fields */ }
Expand description
Let’s you build redis time series filter query options via a builder pattern. Filters can be used in different commands like TS.MGET, TS.MRANGE and TS.QUERYINDEX.
Implementations§
source§impl TsFilterOptions
impl TsFilterOptions
TsFilterOptions allows you to build up your redis time series filter query. It supports default and a builder pattern so you can use it the following way:
use redis_ts::TsFilterOptions;
let filters = TsFilterOptions::default()
.with_labels(true)
.equals("label_1", "value_1")
.not_equals("label_2", "hello")
.in_set("label_3", vec!["a", "b", "c"])
.not_in_set("label_3", vec!["d", "e"])
.has_label("some_other")
.not_has_label("unwanted");
sourcepub fn with_labels(self, value: bool) -> Self
pub fn with_labels(self, value: bool) -> Self
Will add the WITHLABELS flag to the filter query. The query response will have label information attached.
sourcepub fn equals<L: Display + ToRedisArgs, V: Display + ToRedisArgs>(
self,
name: L,
value: V
) -> Self
pub fn equals<L: Display + ToRedisArgs, V: Display + ToRedisArgs>( self, name: L, value: V ) -> Self
Select time series where the given label contains the the given value.
sourcepub fn not_equals<L: Display + ToRedisArgs, V: Display + ToRedisArgs>(
self,
name: L,
value: V
) -> Self
pub fn not_equals<L: Display + ToRedisArgs, V: Display + ToRedisArgs>( self, name: L, value: V ) -> Self
Select time series where given label does not contain the given value.
sourcepub fn in_set<L: Display + ToRedisArgs, V: Display + ToRedisArgs>(
self,
name: L,
values: Vec<V>
) -> Self
pub fn in_set<L: Display + ToRedisArgs, V: Display + ToRedisArgs>( self, name: L, values: Vec<V> ) -> Self
Select time series where given label contains any of the given values.
sourcepub fn not_in_set<L: Display + ToRedisArgs, V: Display + ToRedisArgs>(
self,
name: L,
values: Vec<V>
) -> Self
pub fn not_in_set<L: Display + ToRedisArgs, V: Display + ToRedisArgs>( self, name: L, values: Vec<V> ) -> Self
Select time series where given label does not contain any of the given values.
sourcepub fn has_label<L: Display + ToRedisArgs>(self, name: L) -> Self
pub fn has_label<L: Display + ToRedisArgs>(self, name: L) -> Self
Select all time series that have the given label.
sourcepub fn not_has_label<L: Display + ToRedisArgs>(self, name: L) -> Self
pub fn not_has_label<L: Display + ToRedisArgs>(self, name: L) -> Self
Select all time series that do not have the given label.
pub fn get_filters(self) -> Vec<TsFilter>
Trait Implementations§
source§impl Clone for TsFilterOptions
impl Clone for TsFilterOptions
source§fn clone(&self) -> TsFilterOptions
fn clone(&self) -> TsFilterOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TsFilterOptions
impl Debug for TsFilterOptions
source§impl Default for TsFilterOptions
impl Default for TsFilterOptions
source§fn default() -> TsFilterOptions
fn default() -> TsFilterOptions
source§impl ToRedisArgs for TsFilterOptions
impl ToRedisArgs for TsFilterOptions
source§fn write_redis_args<W>(&self, out: &mut W)where
W: ?Sized + RedisWrite,
fn write_redis_args<W>(&self, out: &mut W)where
W: ?Sized + RedisWrite,
source§fn to_redis_args(&self) -> Vec<Vec<u8>>
fn to_redis_args(&self) -> Vec<Vec<u8>>
source§fn describe_numeric_behavior(&self) -> NumericBehavior
fn describe_numeric_behavior(&self) -> NumericBehavior
INCR
vs INCRBYFLOAT
).source§fn is_single_arg(&self) -> bool
fn is_single_arg(&self) -> bool
GET
and MGET
variants.