refactor dyn KvTree out of services

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-28 22:51:39 +00:00
parent 57acc4f655
commit cb48e25783
69 changed files with 594 additions and 647 deletions

View file

@ -1,18 +1,17 @@
use std::{mem::size_of, sync::Arc};
use database::KvTree;
use crate::{utils, KeyValueDatabase, Result};
use conduit::{utils, Result};
use database::{Database, Map};
pub(super) struct Data {
shorteventid_authchain: Arc<dyn KvTree>,
db: Arc<KeyValueDatabase>,
shorteventid_authchain: Arc<Map>,
db: Arc<Database>,
}
impl Data {
pub(super) fn new(db: &Arc<KeyValueDatabase>) -> Self {
pub(super) fn new(db: &Arc<Database>) -> Self {
Self {
shorteventid_authchain: db.shorteventid_authchain.clone(),
shorteventid_authchain: db["shorteventid_authchain"].clone(),
db: db.clone(),
}
}