pub struct TsOptions { /* private fields */ }
Expand description
Options for a redis time series key. Can be used in multiple redis time series calls (CREATE, ALTER, ADD, …). The uncompressed option will only be respected in a TS.CREATE.
Implementations§
source§impl TsOptions
impl TsOptions
TsOptions allows you to build up your redis time series configuration. It supports default and a builder pattern so you can use it the following way:
use redis_ts::TsOptions;
use redis_ts::TsDuplicatePolicy;
let opts:TsOptions = TsOptions::default()
.retention_time(60000)
.uncompressed(false)
.chunk_size(16000)
.duplicate_policy(TsDuplicatePolicy::Last)
.label("label_1", "value_1")
.label("label_2", "value_2");
sourcepub fn retention_time(self, time: u64) -> Self
pub fn retention_time(self, time: u64) -> Self
Specifies the retention time in millis for this time series options.
sourcepub fn uncompressed(self, value: bool) -> Self
pub fn uncompressed(self, value: bool) -> Self
Switches this time series into uncompressed mode. Note that redis ts only respects this flag in TS.CREATE. All other options usages will ignore this flag.
sourcepub fn labels(self, labels: Vec<(&str, &str)>) -> Self
pub fn labels(self, labels: Vec<(&str, &str)>) -> Self
Resets all labels to the items in given labels. All labels that where previously present will be removed. If the labels are empty no labels will be used for the time series.
sourcepub fn label(self, name: &str, value: &str) -> Self
pub fn label(self, name: &str, value: &str) -> Self
Adds a single label to this time series options.
sourcepub fn duplicate_policy(self, policy: TsDuplicatePolicy) -> Self
pub fn duplicate_policy(self, policy: TsDuplicatePolicy) -> Self
Overrides the servers default dplicatePoliciy.
sourcepub fn chunk_size(self, size: u64) -> Self
pub fn chunk_size(self, size: u64) -> Self
Sets the allocation size for data in bytes.
Trait Implementations§
source§impl ToRedisArgs for TsOptions
impl ToRedisArgs for TsOptions
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.