1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
mod author;
mod entry;

use std::fmt;
use std::hash::Hash;

use serde_json::Value;

pub use author::{AuthorKey, Author};
pub use entry::{EntryKey, Entry, KEY_PREFIX, KEY_SUFFIX};

use serde::Serialize;

pub trait Metadata<T>
where T: Serialize + fmt::Display + Hash
{
    fn new() -> Self;
    fn add(&mut self, key: T, value: String) -> Option<String>;
    fn get(&self, key: T) -> Option<String>;
    fn has(&self, key: T) -> bool;
    fn to_json(&self) -> Value;
}