Skip to main content

sort_topological

Function sort_topological 

Source
pub fn sort_topological<T, K, FK, FD>(
    items: &mut Vec<T>,
    key_fn: FK,
    dependencies_fn: FD,
)
where T: Debug, K: Debug + Copy + Ord, FK: Fn(&T) -> K, FD: Fn(&T) -> BTreeSet<K>,
Expand description

Sort items in dependency order using topological sort.

ยงPanics

Panics if key_fn produces non-unique keys for the provided items. Panics if there is a dependency cycle among the provided items.