diff options
author | Katharina Fey <kookie@spacekookie.de> | 2017-12-14 02:18:53 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2017-12-14 02:18:53 +0100 |
commit | 54075ef02db9ea054000b07f9a498e560708a47a (patch) | |
tree | 5f7cbc46f527991fd818df7dfd15d6d365b80601 /src/record/mod.rs | |
parent | ebf8595cc67c2807d6103007bdb29d01db833092 (diff) |
Using versions to build records and adjusting the demo to use this
A record is now a collection of versions. A version is a collection
of operations. Data can be overwritten by later versions, still preserving
older versions of data fields.
TODO: This means we actually need an API to scrub data from the history
Diffstat (limited to '')
-rw-r--r-- | src/record/mod.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/record/mod.rs b/src/record/mod.rs index 0ce20c5..1963ce1 100644 --- a/src/record/mod.rs +++ b/src/record/mod.rs @@ -3,8 +3,8 @@ //! A record is a set of key-value store values with a header //! -mod version; -use self::version::{Version, Operation}; +pub mod version; +pub use self::version::Version; use std::collections::BTreeMap; use chrono::{DateTime, Local}; @@ -115,11 +115,6 @@ impl Record { return first.flatten(); } - /// Set a simple key-value pair - pub fn set_data(&mut self, key: &str, val: Payload) { - // self.body.insert(String::from(key), val); - } - /// Add a new tag to this record head. Checks that tags don't already exists pub fn add_tag(&mut self, tag: &str) { self.header.tags.push(String::from(tag)); |