mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 04:53:01 +02:00
devirtualize service Data traits
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
a6edaad6fc
commit
7ad7badd60
64 changed files with 1190 additions and 1176 deletions
|
@ -1,3 +1,6 @@
|
|||
use conduit::Server;
|
||||
use database::KeyValueDatabase;
|
||||
|
||||
mod data;
|
||||
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
@ -13,10 +16,16 @@ use serde_json::json;
|
|||
use crate::{services, Error, PduEvent, Result};
|
||||
|
||||
pub struct Service {
|
||||
pub db: Arc<dyn Data>,
|
||||
pub db: Data,
|
||||
}
|
||||
|
||||
impl Service {
|
||||
pub fn build(_server: &Arc<Server>, db: &Arc<KeyValueDatabase>) -> Result<Self> {
|
||||
Ok(Self {
|
||||
db: Data::new(db),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn threads_until<'a>(
|
||||
&'a self, user_id: &'a UserId, room_id: &'a RoomId, until: u64, include: &'a IncludeThreads,
|
||||
) -> Result<impl Iterator<Item = Result<(u64, PduEvent)>> + 'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue