devirtualize service Data traits

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2024-06-30 18:01:20 +00:00
1 parent a6edaad6fc
commit 7ad7badd60
64 files changed
+1190 -1176

No files matched your search

+10 -1
View File
@@ -1,3 +1,6 @@
use conduit::Server;
use database::KeyValueDatabase;
mod data;
use std::sync::Arc;
@@ -8,10 +11,16 @@ use ruma::{OwnedRoomId, RoomId};
use crate::Result;
pub struct Service {
pub db: Arc<dyn Data>,
db: Data,
}
impl Service {
pub fn build(_server: &Arc<Server>, db: &Arc<KeyValueDatabase>) -> Result<Self> {
Ok(Self {
db: Data::new(db),
})
}
#[tracing::instrument(skip(self))]
pub fn set_public(&self, room_id: &RoomId) -> Result<()> { self.db.set_public(room_id) }