aboutsummaryrefslogtreecommitdiff
path: root/src/vault/record.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/vault/record.rs')
-rw-r--r--src/vault/record.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vault/record.rs b/src/vault/record.rs
index 95e7b25..035d3da 100644
--- a/src/vault/record.rs
+++ b/src/vault/record.rs
@@ -3,7 +3,7 @@
use std::collections::BTreeMap;
-use vault::{Header, Record};
+use vault::{Header, Record, Payload};
use chrono::{Local};
@@ -39,8 +39,13 @@ impl Record {
};
}
+ /// 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));
}
} \ No newline at end of file