Struct Take

struct Take<I> { ... }

An iterator that only iterates over the first n iterations of iter.

This struct is created by the take method on Iterator. See its documentation for more.

Implementations

impl<F: FnMut() -> A, A> ExactSizeIterator for Take<RepeatWith<F>>

fn len(self: &Self) -> usize

impl<I> DoubleEndedIterator for Take<I>

fn next_back(self: &mut Self) -> Option<<Self as >::Item>
fn nth_back(self: &mut Self, n: usize) -> Option<<Self as >::Item>
fn try_rfold<Acc, Fold, R>(self: &mut Self, init: Acc, fold: Fold) -> R
where
    Self: Sized,
    Fold: FnMut(Acc, <Self as >::Item) -> R,
    R: Try<Output = Acc>
fn rfold<Acc, Fold>(self: Self, init: Acc, fold: Fold) -> Acc
where
    Self: Sized,
    Fold: FnMut(Acc, <Self as >::Item) -> Acc
fn advance_back_by(self: &mut Self, n: usize) -> Result<(), NonZero<usize>>

impl<I> ExactSizeIterator for Take<I>

impl<I> Freeze for Take<I>

impl<I> FusedIterator for Take<I>

impl<I> IntoIterator for Take<I>

fn into_iter(self: Self) -> I

impl<I> Iterator for Take<I>

fn next(self: &mut Self) -> Option<<I as Iterator>::Item>
fn nth(self: &mut Self, n: usize) -> Option<<I as >::Item>
fn size_hint(self: &Self) -> (usize, Option<usize>)
fn try_fold<Acc, Fold, R>(self: &mut Self, init: Acc, fold: Fold) -> R
where
    Fold: FnMut(Acc, <Self as >::Item) -> R,
    R: Try<Output = Acc>
fn fold<B, F>(self: Self, init: B, f: F) -> B
where
    Self: Sized,
    F: FnMut(B, <Self as >::Item) -> B
fn for_each<F: FnMut(<Self as >::Item)>(self: Self, f: F)
fn advance_by(self: &mut Self, n: usize) -> Result<(), NonZero<usize>>

impl<I> RefUnwindSafe for Take<I>

impl<I> Send for Take<I>

impl<I> Sync for Take<I>

impl<I> Unpin for Take<I>

impl<I> UnsafeUnpin for Take<I>

impl<I> UnwindSafe for Take<I>

impl<I: $crate::clone::Clone> Clone for Take<I>

fn clone(self: &Self) -> Take<I>

impl<I: $crate::fmt::Debug> Debug for Take<I>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<I: TrustedLen> TrustedLen for Take<I>

impl<T> Any for Take<I>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Take<I>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Take<I>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Take<I>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Take<I>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Take<I>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Take<I>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Take<I>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T: Clone> DoubleEndedIterator for Take<Repeat<T>>

fn next_back(self: &mut Self) -> Option<<Self as >::Item>
fn nth_back(self: &mut Self, n: usize) -> Option<<Self as >::Item>
fn try_rfold<Acc, Fold, R>(self: &mut Self, init: Acc, fold: Fold) -> R
where
    Self: Sized,
    Fold: FnMut(Acc, <Self as >::Item) -> R,
    R: Try<Output = Acc>
fn rfold<Acc, Fold>(self: Self, init: Acc, fold: Fold) -> Acc
where
    Self: Sized,
    Fold: FnMut(Acc, <Self as >::Item) -> Acc
fn advance_back_by(self: &mut Self, n: usize) -> Result<(), NonZero<usize>>

impl<T: Clone> ExactSizeIterator for Take<Repeat<T>>

fn len(self: &Self) -> usize