Update readme for repo

This commit is contained in:
Devin R 2020-07-18 16:18:44 -04:00
parent d3c3c95985
commit b2cbc3cd5d

View File

@ -17,22 +17,26 @@ impl StateResV2 {
} }
// The tricky part to making this a good abstraction // The tricky part of making a good abstraction
trait StateStore { trait StateStore {
fn get_event(&self, event_id: &EventId) -> Pdu/AnyStateEvent; /// Return a single event based on the EventId.
fn get_event(&self, event_id: &EventId) -> Result<StateEvent, String>;
fn get_events(&self, event_ids: &[EventId]) -> Pdu/AnyStateEvent; /// 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>;
fn auth_event_ids(&self, room_id: &RoomId, event_id: &EventId) -> Vec<EventId>; /// Returns a Vec of the related auth events to the given `event`.
fn auth_event_ids(&self, room_id: &RoomId, event_id: &EventId) -> Result<Vec<EventId>, String>;
/// Returns a tuple of requested state events from `event_id` and the auth chain events that
/// they relate to the.
fn get_remote_state_for_room( fn get_remote_state_for_room(
&self, &self,
room_id: &RoomId, room_id: &RoomId,
version: &RoomVersionId, version: &RoomVersionId,
event_id: &EventId, event_id: &EventId,
) -> (Vec<StateEvent>, Vec<StateEvent>); ) -> Result<(Vec<StateEvent>, Vec<StateEvent>), String>;
} }
``` ```
Now to be totally fair I have no real understanding of state reso