From 842feabced55fb77060369c41a18c6ec27fcd70f Mon Sep 17 00:00:00 2001 From: Tglman Date: Thu, 13 Oct 2022 20:02:36 +0100 Subject: [PATCH] fix: update persy implementation after refactor --- src/database/abstraction/persy.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/database/abstraction/persy.rs b/src/database/abstraction/persy.rs index e78e731d..1fa7a0df 100644 --- a/src/database/abstraction/persy.rs +++ b/src/database/abstraction/persy.rs @@ -1,6 +1,6 @@ use crate::{ database::{ - abstraction::{watchers::Watchers, DatabaseEngine, Tree}, + abstraction::{watchers::Watchers, KeyValueDatabaseEngine, KvTree}, Config, }, Result, @@ -15,7 +15,7 @@ pub struct Engine { persy: Persy, } -impl DatabaseEngine for Arc { +impl KeyValueDatabaseEngine for Arc { fn open(config: &Config) -> Result { let mut cfg = persy::Config::new(); cfg.change_cache_size((config.db_cache_capacity_mb * 1024.0 * 1024.0) as u64); @@ -27,7 +27,7 @@ impl DatabaseEngine for Arc { Ok(Arc::new(Engine { persy })) } - fn open_tree(&self, name: &'static str) -> Result> { + fn open_tree(&self, name: &'static str) -> Result> { // Create if it doesn't exist if !self.persy.exists_index(name)? { let mut tx = self.persy.begin()?; @@ -61,7 +61,7 @@ impl PersyTree { } } -impl Tree for PersyTree { +impl KvTree for PersyTree { fn get(&self, key: &[u8]) -> Result>> { let result = self .persy