#![allow(dead_code)] use std::fmt::Debug; use serde::de::DeserializeOwned; use serde::Serialize; pub mod logging; pub mod models; pub trait GeoffreyDatabaseModel: Serialize + DeserializeOwned + Debug { fn id(&self) -> Option; fn set_id(&mut self, id: u64); fn tree() -> String; fn check_unique(&self, _: &Self) -> bool { true } fn to_json_string(&self) -> Result { serde_json::to_string(self) } fn try_from_str(s: &str) -> Result { serde_json::from_str(s) } fn to_bytes(&self) -> Result, serde_json::Error> { serde_json::to_vec(self) } fn try_from_bytes(b: &[u8]) -> Result { serde_json::from_slice(b) } }