use std::{error::Error, sync::Arc}; use super::{Config, KvTree}; use crate::Result; pub(crate) trait KeyValueDatabaseEngine: Send + Sync { fn open(config: &Config) -> Result where Self: Sized; fn open_tree(&self, name: &'static str) -> Result>; fn flush(&self) -> Result<()>; #[allow(dead_code)] fn sync(&self) -> Result<()> { Ok(()) } fn cork(&self) -> Result<()> { Ok(()) } fn uncork(&self) -> Result<()> { Ok(()) } fn corked(&self) -> bool { false } fn cleanup(&self) -> Result<()> { Ok(()) } fn memory_usage(&self) -> Result { Ok("Current database engine does not support memory usage reporting.".to_owned()) } #[allow(dead_code)] fn clear_caches(&self) {} fn backup(&self) -> Result<(), Box> { unimplemented!() } fn backup_list(&self) -> Result { Ok(String::new()) } fn file_list(&self) -> Result { Ok(String::new()) } }