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§

source

fn next_value(&self) -> Option<Value>

Produces the next value from the iterator.

Provided Methods§

source

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.

Implementors§