module std::iterablesource
The iteration interfaces driving for loops.
Both are lang items (LANGUAGE_SPEC.md section 6.1a) at the canonical
paths std::iterable::Iterable and std::iterable::Iterator. Fixed
arrays, slices, heap arrays, and ranges are for-compatible natively
(section 5.3) and take no marker; a custom type becomes a for
subject by conforming to Iterable, whose iterator yields a cursor
conforming to Iterator. Fully instantiated, they also form interface
objects (it: &var Iterator<u64>) dispatching to a concrete cursor
unknown until runtime (section 6.2).
interface Iteratorsource
exp interface Iterator<T>
The cursor: next advances and yields a reference to the next
element in place, or None when exhausted.
Required functions
fn next(self: &var) -> Option<&T>;
Implemented by
interface Iterablesource
exp interface Iterable<T, It: Iterator<T>>
The container: iterator yields a fresh cursor by value. Each
conforming type binds It to its concrete cursor type.
Required functions
fn iterator(self: &) -> It;