ruwuma/src/state_store.rs
Devin R 0c21f38cb1 Fixing failing first failing state res test
lexicographical_topological_sort test passes. Chasing bug somewhere in
resolve.
2020-07-20 22:02:29 -04:00

26 lines
831 B
Rust

use ruma::identifiers::{EventId, RoomId};
use crate::StateEvent;
pub trait StateStore {
/// Return a single event based on the EventId.
fn get_event(&self, event_id: &EventId) -> Result<StateEvent, String>;
/// Returns the events that correspond to the `event_ids` sorted in the same order.
fn get_events(&self, event_ids: &[EventId]) -> Result<Vec<StateEvent>, String>;
/// Returns a Vec of the related auth events to the given `event`.
fn auth_event_ids(
&self,
room_id: &RoomId,
event_ids: &[EventId],
) -> Result<Vec<EventId>, String>;
/// Returns a Vec<EventId> representing the difference in auth chains of the given `events`.
fn auth_chain_diff(
&self,
room_id: &RoomId,
event_id: &[&EventId],
) -> Result<Vec<EventId>, String>;
}