pub trait Iterable: Sized {
type Item;
// Required methods
fn expand(self, scope: &Scope, body: &mut dyn FnMut(&Scope, Self::Item));
fn expand_unroll(
self,
scope: &Scope,
body: &mut dyn FnMut(&Scope, Self::Item),
);
// Provided method
fn const_len(&self) -> Option<usize> { ... }
}Expand description
Something that can be iterated on by a for loop. Currently only includes Range, StepBy and
Sequence.
Required Associated Types§
Required Methods§
Sourcefn expand(self, scope: &Scope, body: &mut dyn FnMut(&Scope, Self::Item))
fn expand(self, scope: &Scope, body: &mut dyn FnMut(&Scope, Self::Item))
Expand a runtime loop without unrolling
§Arguments
scope- the expansion scopebody- the loop body to be executed repeatedly
The body is a trait object rather than an impl FnMut so that this
expands once per iterable instead of once per loop body. See
for_expand.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".