Add wrapper types for short IDs

This commit is contained in:
Lambda 2024-08-27 14:27:12 +00:00
parent f1642c92d1
commit b0f33207fe
28 changed files with 427 additions and 232 deletions

View file

@ -2,7 +2,10 @@ use std::sync::Arc;
use ruma::{EventId, RoomId, UserId};
use crate::{service::rooms::timeline::PduCount, PduEvent, Result};
use crate::{
service::rooms::{short::ShortRoomId, timeline::PduCount},
PduEvent, Result,
};
pub(crate) trait Data: Send + Sync {
fn add_relation(&self, from: u64, to: u64) -> Result<()>;
@ -10,7 +13,7 @@ pub(crate) trait Data: Send + Sync {
fn relations_until<'a>(
&'a self,
user_id: &'a UserId,
room_id: u64,
room_id: ShortRoomId,
target: u64,
until: PduCount,
) -> Result<Box<dyn Iterator<Item = Result<(PduCount, PduEvent)>> + 'a>>;