use std::sync::Arc; use ruma::{events::StateEventType, EventId, RoomId}; use crate::Result; pub trait Data: Send + Sync { fn get_or_create_shorteventid(&self, event_id: &EventId) -> Result; fn multi_get_or_create_shorteventid(&self, event_id: &[&EventId]) -> Result>; fn get_shortstatekey(&self, event_type: &StateEventType, state_key: &str) -> Result>; fn get_or_create_shortstatekey(&self, event_type: &StateEventType, state_key: &str) -> Result; fn get_eventid_from_short(&self, shorteventid: u64) -> Result>; fn get_statekey_from_short(&self, shortstatekey: u64) -> Result<(StateEventType, String)>; /// Returns (shortstatehash, already_existed) fn get_or_create_shortstatehash(&self, state_hash: &[u8]) -> Result<(u64, bool)>; fn get_shortroomid(&self, room_id: &RoomId) -> Result>; fn get_or_create_shortroomid(&self, room_id: &RoomId) -> Result; }