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
+7 -6
View File
@@ -1,18 +1,19 @@
use std::sync::Arc;
use database::KvTree;
use conduit::{Error, Result};
use database::{Database, Map};
use ruma::{CanonicalJsonObject, EventId};
use crate::{Error, KeyValueDatabase, PduEvent, Result};
use crate::PduEvent;
pub struct Data {
eventid_outlierpdu: Arc<dyn KvTree>,
pub(super) struct Data {
eventid_outlierpdu: Arc<Map>,
}
impl Data {
pub(super) fn new(db: &Arc<KeyValueDatabase>) -> Self {
pub(super) fn new(db: &Arc<Database>) -> Self {
Self {
eventid_outlierpdu: db.eventid_outlierpdu.clone(),
eventid_outlierpdu: db["eventid_outlierpdu"].clone(),
}
}