Struct redis_ts::TsRangeQuery
source · pub struct TsRangeQuery { /* private fields */ }
Expand description
Let’s you build a ts range query with all options via a builder pattern:
use redis_ts::{TsAggregationType, TsBucketTimestamp, TsRangeQuery};
let query = TsRangeQuery::default()
.from(1234)
.to(5678)
.latest(true)
.filter_by_value(1.0, 5.0)
.aggregation_type(TsAggregationType::Avg(5000))
.bucket_timestamp(TsBucketTimestamp::High)
.empty(true);
Implementations§
source§impl TsRangeQuery
impl TsRangeQuery
sourcepub fn from<T: Into<Integer>>(self, from: T) -> Self
pub fn from<T: Into<Integer>>(self, from: T) -> Self
Start timestamp of the series to query. Defaults to ‘-’ (earliest sample) if left empty.
sourcepub fn to<T: Into<Integer>>(self, to: T) -> Self
pub fn to<T: Into<Integer>>(self, to: T) -> Self
End timestamp of the series to query. Defaults to ‘+’ (latest sample) if left empty.
sourcepub fn filter_by_ts<T: Into<Integer>>(self, ts: Vec<T>) -> Self
pub fn filter_by_ts<T: Into<Integer>>(self, ts: Vec<T>) -> Self
Will enable the FILTER_BY_TS option with given timestamps. Will only be added if the given Vec contains any ts values.
sourcepub fn filter_by_value(self, min: f64, max: f64) -> Self
pub fn filter_by_value(self, min: f64, max: f64) -> Self
Will enable the FILTER_BY_VALUE option with given min and max values.
sourcepub fn align(self, align: TsAlign) -> Self
pub fn align(self, align: TsAlign) -> Self
Controls the aggregation alignment. Will only be added if the query actually contains aggregation params.
sourcepub fn aggregation_type(self, aggregation_type: TsAggregationType) -> Self
pub fn aggregation_type(self, aggregation_type: TsAggregationType) -> Self
The type of aggregation to be performed on the series.
sourcepub fn bucket_timestamp(self, bucket_timestamp: TsBucketTimestamp) -> Self
pub fn bucket_timestamp(self, bucket_timestamp: TsBucketTimestamp) -> Self
Controls reporting of aggregation bucket timestamps. Will only be added if the query actually contains aggregation params.
Trait Implementations§
source§impl Clone for TsRangeQuery
impl Clone for TsRangeQuery
source§fn clone(&self) -> TsRangeQuery
fn clone(&self) -> TsRangeQuery
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TsRangeQuery
impl Debug for TsRangeQuery
source§impl Default for TsRangeQuery
impl Default for TsRangeQuery
source§fn default() -> TsRangeQuery
fn default() -> TsRangeQuery
Returns the “default value” for a type. Read more
source§impl ToRedisArgs for TsRangeQuery
impl ToRedisArgs for TsRangeQuery
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,
This writes the value into a vector of bytes. Each item
is a single argument. Most items generate a single item. Read more
source§fn to_redis_args(&self) -> Vec<Vec<u8>>
fn to_redis_args(&self) -> Vec<Vec<u8>>
This converts the value into a vector of bytes. Each item
is a single argument. Most items generate a vector of a
single item. Read more
source§fn describe_numeric_behavior(&self) -> NumericBehavior
fn describe_numeric_behavior(&self) -> NumericBehavior
Returns an information about the contained value with regards
to it’s numeric behavior in a redis context. This is used in
some high level concepts to switch between different implementations
of redis functions (for instance
INCR
vs INCRBYFLOAT
).source§fn is_single_arg(&self) -> bool
fn is_single_arg(&self) -> bool
Returns an indiciation if the value contained is exactly one
argument. It returns false if it’s zero or more than one. This
is used in some high level functions to intelligently switch
between
GET
and MGET
variants.Auto Trait Implementations§
impl Freeze for TsRangeQuery
impl RefUnwindSafe for TsRangeQuery
impl Send for TsRangeQuery
impl Sync for TsRangeQuery
impl Unpin for TsRangeQuery
impl UnwindSafe for TsRangeQuery
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more