Skip to main content

branches

Function branches 

Source
pub fn branches<T, K>(
    f: impl Fn() -> Vec<T> + 'static,
    key_of: impl Fn(&T) -> K + 'static,
    parent_of: impl Fn(&T) -> Option<K> + 'static,
) -> Branches<T, K>
where T: Clone + 'static, K: Clone + Hash + Eq + 'static,
Expand description

Plain-data tree rows: a flat items closure, a key per item, and a parent key per item (None = a root row), as in tree(branches(model::all, |n| n.id, |n| n.parent), row_view). Children keep the items’ own relative order; an item whose parent key is absent from the set is treated as a root row rather than dropped.

Day API ↩ Guides· daybrite.dev