pub unsafe trait NormalizedRangeIterator: Iterator<Item = Range> {
// Provided methods
fn filter_map_ranges<F>(self, f: F) -> FilterMapRanges<Self, F> ⓘ
where Self: Sized,
F: Fn(Type) -> Option<Type> { ... }
fn filter_map_ram(self) -> impl NormalizedRangeIterator
where Self: Sized { ... }
}Expand description
An iterator over a normalized collection of ranges.
A normalized collection of ranges is one in which the ranges are:
- Lexicographically sorted on endpoint
- Mutually disjoint
- Maximally contiguous (adjacent ranges never share the same type)
§Safety
Implementors must guarantee that the items in iteration order are indeed normalized
Provided Methods§
Sourcefn filter_map_ranges<F>(self, f: F) -> FilterMapRanges<Self, F> ⓘ
fn filter_map_ranges<F>(self, f: F) -> FilterMapRanges<Self, F> ⓘ
Creates a normalized range iterator which maps and filters out the range type.
f serves as the map that determines which types maps to which, and which are discarded
or filtered out.
Sourcefn filter_map_ram(self) -> impl NormalizedRangeIteratorwhere
Self: Sized,
fn filter_map_ram(self) -> impl NormalizedRangeIteratorwhere
Self: Sized,
Creates a normalized range iterator which forgets about non-ram types, and sees allocated types as free ram.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
impl<I> NormalizedRangeIterator for Peekable<I>where
I: NormalizedRangeIterator,
Safety:
Peekable yields the exact same items in the exact same order as the underlying iterator.
Implementors§
impl<I, F> NormalizedRangeIterator for FilterMapRanges<I, F>
Safety: Merging of neighboring ranges while tweaking types preserves normalization.