pub trait IfDeterminismIteratorExt: Iterator + Sealed {
// Provided methods
fn if_determinism_then_sort(self) -> IntoIter<Self::Item>
where Self: Sized,
Self::Item: Ord { ... }
fn if_determinism_then_sort_by<F>(self, cmp: F) -> IntoIter<Self::Item>
where Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering { ... }
}Expand description
Extensions of iterator to sort items of the iterator. Replaced by a no-op when determinism is switched off.
Useful, for example, to eliminate non-deterministic iteration of HashMap and HashSet keys.
Provided Methods§
Sourcefn if_determinism_then_sort(self) -> IntoIter<Self::Item>
fn if_determinism_then_sort(self) -> IntoIter<Self::Item>
Sorts the slice. Replaced by a no-op when determinism is switched off.
Useful, for example, to eliminate non-deterministic iteration of HashMap and HashSet keys.
Sourcefn if_determinism_then_sort_by<F>(self, cmp: F) -> IntoIter<Self::Item>
fn if_determinism_then_sort_by<F>(self, cmp: F) -> IntoIter<Self::Item>
Sorts the slice with a comparator function. Replaced by a no-op when determinism is switched off.
Useful, for example, to eliminate non-deterministic iteration of HashMap and HashSet keys.