pub enum IteratorTransform {
Map(Arc<HeapValue>),
Filter(Arc<HeapValue>),
Take(usize),
Skip(usize),
FlatMap(Arc<HeapValue>),
Enumerate,
Chain(Arc<IteratorState>),
}Expand description
Lazy transform stage in an iterator pipeline. Each closure-bearing
variant stores the callback as Arc<HeapValue> per ADR-006 §2.3 /
§2.7.11 — the same share carrier the op_call_value /
call_value_immediate_nb path consumes (the slot bits at the §2.7.7
stack tier are Arc::into_raw(Arc<HeapValue>) pointing to a
HeapValue::ClosureRaw(OwnedClosureBlock) arm; the iterator-state
stash here keeps an extra share alive for the iterator’s lifetime).
Variants§
Map(Arc<HeapValue>)
iter.map(closure) — replace each element with closure(element).
Filter(Arc<HeapValue>)
iter.filter(predicate) — drop elements where predicate(element)
returns false.
Take(usize)
iter.take(n) — limit the output to the first n elements.
Skip(usize)
iter.skip(n) — drop the first n elements before yielding.
FlatMap(Arc<HeapValue>)
iter.flatMap(closure) — replace each element with the array
returned by closure(element) and concatenate the results.
Enumerate
iter.enumerate() — replace each element e with the 2-element
inner array [index, e].
Chain(Arc<IteratorState>)
iter.chain(other) — append other’s elements after self’s
elements. The other iterator is materialized at terminal-evaluation
time, sharing its source/transforms with no deep copy.
Trait Implementations§
Source§impl Clone for IteratorTransform
impl Clone for IteratorTransform
Source§fn clone(&self) -> IteratorTransform
fn clone(&self) -> IteratorTransform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more