pub trait TakeExact: Iterator {
// Provided method
fn take_exact(self, n: usize) -> TakeExactIter<Self> ⓘ
where Self: Sized { ... }
}Expand description
A trait for iterators that take exactly N elements, panicking if the iterator is shorter than N.
Provided Methods§
Sourcefn take_exact(self, n: usize) -> TakeExactIter<Self> ⓘwhere
Self: Sized,
fn take_exact(self, n: usize) -> TakeExactIter<Self> ⓘwhere
Self: Sized,
Takes exactly n elements from the iterator, panicking if the iterator
is shorter than n. Returns an iterator that implements ExactSizeIterator.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".