Trait rocket_dyn_templates::minijinja::value::IteratorObject
source · pub trait IteratorObject: Send + Sync {
// Required method
fn next_value(&self) -> Option<Value>;
// Provided method
fn iterator_len(&self) -> Option<usize> { ... }
}
Expand description
Represents a dynamic iterable.
Iterators need to use interior mutability to function.
Required Methods§
sourcefn next_value(&self) -> Option<Value>
fn next_value(&self) -> Option<Value>
Produces the next value from the iterator.
Provided Methods§
sourcefn iterator_len(&self) -> Option<usize>
fn iterator_len(&self) -> Option<usize>
Returns the exact size of the iterator if known.
An iterator must only return the length if it’s known and correct.
The default implementation returns None
. If the length is
provided then loop.revindex
and loop.length
will return the
correct information.