Add PduId wrapper struct

Death to Vec<u8>
This commit is contained in:
Lambda 2024-08-26 16:47:50 +00:00
parent 341f4213d0
commit 26322d5a95
15 changed files with 110 additions and 71 deletions

View file

@ -1,19 +1,19 @@
use ruma::RoomId;
use crate::Result;
use crate::{service::rooms::timeline::PduId, Result};
pub(crate) trait Data: Send + Sync {
fn index_pdu(
&self,
shortroomid: u64,
pdu_id: &[u8],
pdu_id: &PduId,
message_body: &str,
) -> Result<()>;
fn deindex_pdu(
&self,
shortroomid: u64,
pdu_id: &[u8],
pdu_id: &PduId,
message_body: &str,
) -> Result<()>;
@ -22,5 +22,5 @@ pub(crate) trait Data: Send + Sync {
&'a self,
room_id: &RoomId,
search_string: &str,
) -> Result<Option<(Box<dyn Iterator<Item = Vec<u8>> + 'a>, Vec<String>)>>;
) -> Result<Option<(Box<dyn Iterator<Item = PduId> + 'a>, Vec<String>)>>;
}