pub fn resolve<'a, E, SetIter>( room_version: &RoomVersionId, state_sets: impl IntoIterator<IntoIter = SetIter>, auth_chain_sets: Vec<HashSet<E::Id>>, fetch_event: impl Fn(&EventId) -> Option<E> ) -> Result<StateMap<E::Id>>where E: Event + Clone, E::Id: 'a, SetIter: Iterator<Item = &'a StateMap<E::Id>> + Clone,
Resolve sets of state events as they come in.
StateResolution builds a graph and an auth chain to allow for state conflict
state_sets- The incoming state to resolve. Each
StateMaprepresents a possible fork in the state of a room.
auth_chain_sets- The full recursive set of
auth_eventsfor each event in the
fetch_event- Any event not found in the
event_mapwill defer to this closure to find the event.
The caller of
resolve must ensure that all the events are from the same room. Although this
function takes a
RoomId it does not check that each event is part of the same room.