mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-20 01:01:24 +01:00
Remove useless wrapper Services
This commit is contained in:
parent
87a1012ab5
commit
ad7a5ea777
20 changed files with 43 additions and 530 deletions
|
|
@ -1,31 +1,4 @@
|
|||
mod data;
|
||||
|
||||
pub(crate) use data::Data;
|
||||
|
||||
use crate::Result;
|
||||
use ruma::RoomId;
|
||||
|
||||
pub(crate) struct Service {
|
||||
pub(crate) db: &'static dyn Data,
|
||||
}
|
||||
|
||||
impl Service {
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub(crate) fn index_pdu(
|
||||
&self,
|
||||
shortroomid: u64,
|
||||
pdu_id: &[u8],
|
||||
message_body: &str,
|
||||
) -> Result<()> {
|
||||
self.db.index_pdu(shortroomid, pdu_id, message_body)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub(crate) fn search_pdus<'a>(
|
||||
&'a self,
|
||||
room_id: &RoomId,
|
||||
search_string: &str,
|
||||
) -> Result<Option<(impl Iterator<Item = Vec<u8>> + 'a, Vec<String>)>> {
|
||||
self.db.search_pdus(room_id, search_string)
|
||||
}
|
||||
}
|
||||
pub(crate) type Service = &'static dyn Data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue