pub trait EndiateIteratorExt: Sized {
// Required methods
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),
]
)
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.