From f74de77ae89b8b5257a203b521ab930111e5a307 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Tue, 19 Dec 2017 01:16:16 -0500 Subject: [PATCH] impl Clone for InfluxWriter --- src/influx.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/influx.rs b/src/influx.rs index 131cec9..ab5ad3f 100644 --- a/src/influx.rs +++ b/src/influx.rs @@ -187,6 +187,19 @@ impl Default for InfluxWriter { } } +impl Clone for InfluxWriter { + fn clone(&self) -> Self { + let (tx, _) = channel(); + InfluxWriter { + host: self.host, + db: self.db, + tx: self.tx.clone(), + kill_switch: tx, + thread: None, + } + } +} + impl InfluxWriter { /// Sends the `OwnedMeasurement` to the serialization thread. ///