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::sync::Arc;
use database::KvTree;
use conduit::Result;
use database::{Database, Map};
use ruma::{DeviceId, RoomId, UserId};
use crate::{KeyValueDatabase, Result};
pub struct Data {
lazyloadedids: Arc<dyn KvTree>,
pub(super) struct Data {
lazyloadedids: Arc<Map>,
}
impl Data {
pub(super) fn new(db: &Arc<KeyValueDatabase>) -> Self {
pub(super) fn new(db: &Arc<Database>) -> Self {
Self {
lazyloadedids: db.lazyloadedids.clone(),
lazyloadedids: db["lazyloadedids"].clone(),
}
}