LendingIterator

Trait LendingIterator 

Source
pub trait LendingIterator {
    type Item<'a>
       where Self: 'a;

    // Required methods
    fn next(&mut self) -> Option<Self::Item<'_>>;
    fn count(self) -> usize;
}
Expand description

The LendingIterator is a version of an Iterator that can yield items with references into the lender. It is a well-known name and there are multiple crates which offer it, with differences. The needs here are small, and so rather than bring in a pre-1.0 crate, just make our own.

Required Associated Types§

Source

type Item<'a> where Self: 'a

Required Methods§

Source

fn next(&mut self) -> Option<Self::Item<'_>>

Source

fn count(self) -> usize

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§

Source§

impl LendingIterator for StringTableIter

Source§

type Item<'a> = &'a str where Self: 'a