mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-12 17:20:57 +00:00
refactor dyn KvTree out of services
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
57acc4f655
commit
cb48e25783
69 changed files with 594 additions and 647 deletions
|
@ -1,25 +1,26 @@
|
|||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use conduit::{utils, warn, Error, Result};
|
||||
use database::{Database, Map};
|
||||
use ruma::{
|
||||
api::client::error::ErrorKind,
|
||||
events::{AnyEphemeralRoomEvent, RoomAccountDataEventType},
|
||||
serde::Raw,
|
||||
RoomId, UserId,
|
||||
};
|
||||
use tracing::warn;
|
||||
|
||||
use crate::{services, utils, Error, KeyValueDatabase, KvTree, Result};
|
||||
use crate::services;
|
||||
|
||||
pub(super) struct Data {
|
||||
roomuserdataid_accountdata: Arc<dyn KvTree>,
|
||||
roomusertype_roomuserdataid: Arc<dyn KvTree>,
|
||||
roomuserdataid_accountdata: Arc<Map>,
|
||||
roomusertype_roomuserdataid: Arc<Map>,
|
||||
}
|
||||
|
||||
impl Data {
|
||||
pub(super) fn new(db: &Arc<KeyValueDatabase>) -> Self {
|
||||
pub(super) fn new(db: &Arc<Database>) -> Self {
|
||||
Self {
|
||||
roomuserdataid_accountdata: db.roomuserdataid_accountdata.clone(),
|
||||
roomusertype_roomuserdataid: db.roomusertype_roomuserdataid.clone(),
|
||||
roomuserdataid_accountdata: db["roomuserdataid_accountdata"].clone(),
|
||||
roomusertype_roomuserdataid: db["roomusertype_roomuserdataid"].clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue