Update readme for repo
@@ -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 {
- 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(
&self,
room_id: &RoomId,
version: &RoomVersionId,
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
