Browse Source

adds Clone to OwnedMeasurement

master
Jonathan Strong 7 years ago
parent
commit
585910867d
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/influx.rs

+ 6
- 0
src/influx.rs View File

@@ -243,6 +243,7 @@ pub enum OwnedValue {
Boolean(bool) Boolean(bool)
} }


#[derive(Clone)]
pub struct OwnedMeasurement { pub struct OwnedMeasurement {
pub key: &'static str, pub key: &'static str,
pub timestamp: Option<i64>, pub timestamp: Option<i64>,
@@ -281,6 +282,11 @@ impl OwnedMeasurement {
self.timestamp = Some(timestamp); self.timestamp = Some(timestamp);
self 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 { pub fn dur_nanos(d: ::std::time::Duration) -> i64 {


Loading…
Cancel
Save