Function ruma_state_res::lexicographical_topological_sort[][src]

pub fn lexicographical_topological_sort<F>(
    graph: &HashMap<EventId, HashSet<EventId>>,
    key_fn: F
) -> Result<Vec<EventId>> where
    F: Fn(&EventId) -> Result<(Int, MilliSecondsSinceUnixEpoch, EventId)>, 
Expand description

Sorts the event graph based on number of outgoing/incoming edges.

key_fn is used as a tie breaker. The tie breaker happens based on power level, age, and event_id.