Trait iter_trait::base::Iter [] [src]

pub trait Iter<'a>: 'a + HasData {
    type ItemRef: Ref<'a, Self::Item>;
    type IterRef: Iterator<Item = Self::ItemRef>;
    fn iter(&'a self) -> Self::IterRef;
}

A trait for collections which can be iterated by reference.

In most cases, you shouldn't implement this trait directly; instead, you should implement IntoIterator for a reference of this type, which will in turn implement this trait.

Associated Types

Type of the references to the data in the collection.

Although this might just be &'a Item, it can also be more complicated. For example, an iterator with Item = (usize, T) might use (usize, &'a T) for this instead.

For more information, see the Ref trait.

Type of the iterator over references.

Required Methods

Constructs an iterator over references to the data in this collection.

Implementors