From 585910867d9882c141b73429b22192f311d59f82 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Tue, 26 Sep 2017 15:47:43 -0400 Subject: [PATCH] adds Clone to OwnedMeasurement --- src/influx.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/influx.rs b/src/influx.rs index a128da4..e2e7e19 100644 --- a/src/influx.rs +++ b/src/influx.rs @@ -243,6 +243,7 @@ pub enum OwnedValue { Boolean(bool) } +#[derive(Clone)] pub struct OwnedMeasurement { pub key: &'static str, pub timestamp: Option, @@ -281,6 +282,11 @@ impl OwnedMeasurement { self.timestamp = Some(timestamp); self } + + pub fn set_tag(mut self, key: &'static str, value: &'static str) -> Self { + *self.tags.entry(key).or_insert(value) = value; + self + } } pub fn dur_nanos(d: ::std::time::Duration) -> i64 {