+impl Serialize for Message {
+ // https://github.com/BurntSushi/rust-csv/issues/155
+ // https://github.com/BurntSushi/rust-csv/issues/98
+ // https://github.com/BurntSushi/rust-csv/pull/223
+ // csv doesn't support #[serde(flatten)], so we implement this directly. :(
+ fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
+ let mut row = serializer.serialize_struct("Message", 4)?;
+ row.serialize_field("epoch", &self.key.epoch)?;
+ row.serialize_field("device", &self.key.device)?;
+ row.serialize_field("seq", &self.key.seq)?;
+ row.serialize_field("t", &self.t)?;
+ row.end()
+ }
+}