changeset 74:fb6d8991bcc9

Add SinkGenerator implementation that yields buffers to write to
author Lewin Bormann <lbo@spheniscida.de>
date Sun, 07 Feb 2016 09:15:47 +0000
parents 7a059fb6186a
children 8ebc14271d3c
files src/formats/fake.rs src/formats/mod.rs
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/formats/fake.rs	Sun Feb 07 09:15:47 2016 +0000
@@ -0,0 +1,18 @@
+use std::collections::BTreeMap;
+use std::io::BufWriter;
+use std::vec;
+
+use record_types::*;
+use formats::util::MRSinkGenerator;
+
+pub struct BufWriterSinkGen {
+    // bogus field so the struct isn't empty
+    i: i32,
+}
+
+impl MRSinkGenerator for BufWriterSinkGen {
+    type Sink = Vec<u8>;
+    fn new_output(&mut self, name: &String) -> Self::Sink {
+        Vec::new()
+    }
+}
--- a/src/formats/mod.rs	Sat Feb 06 18:48:10 2016 +0000
+++ b/src/formats/mod.rs	Sun Feb 07 09:15:47 2016 +0000
@@ -2,4 +2,5 @@
 
 pub mod lines;
 pub mod writelog;
+pub mod fake;
 pub mod util;