0 errors left!

This commit is contained in:
Timo Kösters 2022-10-08 13:02:52 +02:00 committed by Nyaaori
parent f47a5cd5d5
commit d5b4754cf4
No known key found for this signature in database
GPG key ID: E7819C3ED4D1F82E
59 changed files with 656 additions and 563 deletions

View file

@ -2,11 +2,11 @@ use crate::Result;
use ruma::RoomId;
pub trait Data: Send + Sync {
fn index_pdu<'a>(&self, shortroomid: u64, pdu_id: &[u8], message_body: String) -> Result<()>;
fn index_pdu<'a>(&self, shortroomid: u64, pdu_id: &[u8], message_body: &str) -> Result<()>;
fn search_pdus<'a>(
&'a self,
room_id: &RoomId,
search_string: &str,
) -> Result<Option<(Box<dyn Iterator<Item = Vec<u8>>>, Vec<String>)>>;
) -> Result<Option<(Box<dyn Iterator<Item = Vec<u8>>+ 'a>, Vec<String>)>>;
}

View file

@ -7,7 +7,7 @@ use crate::Result;
use ruma::RoomId;
pub struct Service {
db: Arc<dyn Data>,
pub db: &'static dyn Data,
}
impl Service {
@ -16,7 +16,7 @@ impl Service {
&self,
shortroomid: u64,
pdu_id: &[u8],
message_body: String,
message_body: &str,
) -> Result<()> {
self.db.index_pdu(shortroomid, pdu_id, message_body)
}