pub fn resolve<'a, E, MapsIter>(
auth_rules: &AuthorizationRules,
state_res_rules: &StateResolutionV2Rules,
state_maps: impl IntoIterator<IntoIter = MapsIter>,
auth_chains: Vec<HashSet<E::Id>>,
fetch_event: impl Fn(&EventId) -> Option<E>,
fetch_conflicted_state_subgraph: impl Fn(&StateMap<Vec<E::Id>>) -> Option<HashSet<E::Id>>,
) -> Result<StateMap<E::Id>>Expand description
Apply the state resolution algorithm introduced in room version 2 to resolve the state of a room.
§Arguments
-
auth_rules- The authorization rules to apply for the version of the current room. -
state_res_rules- The state resolution rules to apply for the version of the current room. -
state_maps- The incoming states to resolve. EachStateMaprepresents a possible fork in the state of a room. -
auth_chains- The list of full recursive sets ofauth_eventsfor each event in thestate_maps. -
fetch_event- Function to fetch an event in the room given its event ID. -
fetch_conflicted_state_subgraph- Function to fetch the conflicted state subgraph for the given conflicted state set, for state resolution rules that use it. If it is called and returnsNone, this function will return an error.
§Invariants
The caller of resolve must ensure that all the events are from the same room.
§Returns
The resolved room state.