1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
use crate::SusuData;
use crate::susuexceptions::SusuDbException;

pub trait SusuDataTrait {
    fn new() -> Self;
    fn new_data(key: &str, value: &str) -> Self;
    fn to_data_format(&self) -> Result<String, SusuDbException>;
}

pub trait SusuDatabaseTrait {
    fn new() -> Self;
    fn config(&mut self, db_name: &'static str);
    fn get(&self, key: &str) -> Option<String>;
    fn add(&self, item: SusuData) -> bool;
}