Trait iterator_endiate::EndiateIteratorExt
source · pub trait EndiateIteratorExt: Sized {
fn endiate(self) -> Endiate<Self> ⓘ;
fn nendiate(self) -> NEndiate<Self> ⓘ;
}
Expand description
Extension trait for adding EndiateIteratorExt::endiate and EndiateIteratorExt::nendiate
Required Methods§
sourcefn endiate(self) -> Endiate<Self> ⓘ
fn endiate(self) -> Endiate<Self> ⓘ
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),
]
)
sourcefn nendiate(self) -> NEndiate<Self> ⓘ
fn nendiate(self) -> NEndiate<Self> ⓘ
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),
]
)