Iterator

Trait Iterator 

Source
pub trait Iterator<K: KeyExt, V: ValueExt> {
    // Required methods
    fn next(&mut self);
    fn rewind(&mut self);
    fn seek<Q: KeyExt>(&mut self, key: Q);
    fn entry(&self) -> Option<(K, V)>;
    fn key(&self) -> Option<K>;
    fn val(&self) -> Option<V>;
    fn valid(&self) -> bool;

    // Provided methods
    fn size_hint(&self) -> (usize, Option<usize>) { ... }
    fn count(&self) -> usize
       where Self: Sized { ... }
}
Expand description

Custom iterator

Required Methods§

Source

fn next(&mut self)

advance to next

Source

fn rewind(&mut self)

reset to 0

Source

fn seek<Q: KeyExt>(&mut self, key: Q)

seek will reset iterator and seek to >= key.

Source

fn entry(&self) -> Option<(K, V)>

Returns the entry of current position

Source

fn key(&self) -> Option<K>

Returns the key of current position

Source

fn val(&self) -> Option<V>

Returns the value of current position

Source

fn valid(&self) -> bool

Returns if the current position has a valid value.

Provided Methods§

Source

fn size_hint(&self) -> (usize, Option<usize>)

Size hint for this iterator

Source

fn count(&self) -> usize
where Self: Sized,

How many items in this iterator

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§