From b2cbc3cd5d7a8ca40db438ecdeb92eb422b1a0f2 Mon Sep 17 00:00:00 2001 From: Devin R Date: Sat, 18 Jul 2020 16:18:44 -0400 Subject: [PATCH] Update readme for repo --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 38e64375..759c0565 100644 --- a/README.md +++ b/README.md @@ -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; - 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, String>; - fn auth_event_ids(&self, room_id: &RoomId, event_id: &EventId) -> Vec; + /// Returns a Vec of the related auth events to the given `event`. + fn auth_event_ids(&self, room_id: &RoomId, event_id: &EventId) -> Result, 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, Vec); + ) -> Result<(Vec, Vec), String>; } ``` -Now to be totally fair I have no real understanding of state reso