state-res: Update docs

This commit is contained in:
Jonas Platte 2022-09-22 11:48:48 +02:00
parent 97387f36c1
commit a11c27e7e1
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C
2 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ pub trait Event {
}
/// A mapping of event type and state_key to some value `T`, usually an `EventId`.
pub type StateMap<T> = BTreeMap<(EventType, Option<String>), T>;
pub type StateMap<T> = BTreeMap<(StateEventType, Option<String>), T>;
/// A mapping of `EventId` to `T`, usually a `OriginalStateEvent`.
pub type EventMap<T> = BTreeMap<OwnedEventId, T>;
@ -40,6 +40,6 @@ impl StateResolution {
The `StateStore` trait is an abstraction around what ever database your server (or maybe even client) uses to store __P__[]()ersistant __D__[]()ata __U__[]()nits.
The `StateStore` trait is an abstraction around what ever database your server (or maybe even client) uses to store **P**ersistent **D**ata **U**nits.
We use `ruma`s types when deserializing any PDU or it's contents which helps avoid a lot of type checking logic [synapse](https://github.com/matrix-org/synapse) must do while authenticating event chains.

View File

@ -158,9 +158,9 @@ where
///
/// The return tuple looks like `(unconflicted, conflicted)`.
///
/// State is determined to be conflicting if for the given key (EventType, StateKey) there is not
/// exactly one eventId. This includes missing events, if one state_set includes an event that none
/// of the other have this is a conflicting event.
/// State is determined to be conflicting if for the given key (StateEventType, StateKey) there is
/// not exactly one event ID. This includes missing events, if one state_set includes an event that
/// none of the other have this is a conflicting event.
fn separate<'a, Id>(
state_sets_iter: impl Iterator<Item = &'a StateMap<Id>> + Clone,
) -> (StateMap<Id>, StateMap<Vec<Id>>)