Skip to main content

TakeExact

Trait TakeExact 

Source
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§

Source

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".

Implementors§