pub trait SortableWeave<K, N, T>: Weave<K, N, T>{
// Required methods
fn sort_children_by(
&mut self,
id: &K,
cmp: impl FnMut(&N, &N) -> Ordering,
) -> bool;
fn sort_children_by_id(
&mut self,
id: &K,
cmp: impl FnMut(&K, &K) -> Ordering,
) -> bool;
fn sort_roots_by(&mut self, cmp: impl FnMut(&N, &N) -> Ordering);
fn sort_roots_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering);
}Expand description
Required Methods§
Sourcefn sort_children_by(
&mut self,
id: &K,
cmp: impl FnMut(&N, &N) -> Ordering,
) -> bool
fn sort_children_by( &mut self, id: &K, cmp: impl FnMut(&N, &N) -> Ordering, ) -> bool
Sorts the child nodes of a parent node with the specified identifier using the comparison function cmp.
§Panics
May panic if cmp does not implement a total order, or if cmp itself panics.
Sourcefn sort_children_by_id(
&mut self,
id: &K,
cmp: impl FnMut(&K, &K) -> Ordering,
) -> bool
fn sort_children_by_id( &mut self, id: &K, cmp: impl FnMut(&K, &K) -> Ordering, ) -> bool
Sorts the identifiers of a parent node’s children with the specified identifier using the comparison function cmp.
§Panics
May panic if cmp does not implement a total order, or if cmp itself panics.
Sourcefn sort_roots_by(&mut self, cmp: impl FnMut(&N, &N) -> Ordering)
fn sort_roots_by(&mut self, cmp: impl FnMut(&N, &N) -> Ordering)
Sorts root nodes (nodes which do not have any parents) using the comparison function cmp.
§Panics
May panic if cmp does not implement a total order, or if cmp itself panics.
Sourcefn sort_roots_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering)
fn sort_roots_by_id(&mut self, cmp: impl FnMut(&K, &K) -> Ordering)
Sorts the identifiers of root nodes (nodes which do not have any parents) using the comparison function cmp.
§Panics
May panic if cmp does not implement a total order, or if cmp itself panics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".