pub trait EndiateIteratorExt: Sized {
    fn endiate(self) -> Endiate<Self> ;
    fn nendiate(self) -> NEndiate<Self> ;
}
Expand description

Required Methods§

Similar to Iterator::enumerate but rather including indexes, it includes whether the item is the last item in the iterator

use iterator_endiate::EndiateIteratorExt;
let endiate = [1, 2, 3].into_iter().endiate().collect::<Vec<_>>();
assert_eq!(
    endiate,
    [
        (false, 1),
        (false, 2),
        (true, 3),
    ]
)

Same as EndiateIteratorExt::endiate but bool is not at end

use iterator_endiate::EndiateIteratorExt;
let nendiate = [1, 2, 3].into_iter().nendiate().collect::<Vec<_>>();
assert_eq!(
    nendiate,
    [
        (true, 1),
        (true, 2),
        (false, 3),
    ]
)

Implementors§