Struct array_tools::IntoIter[][src]

pub struct IntoIter<T, A> where
    A: FixedSizeArray<T>, 
{ /* fields omitted */ }

A consuming iterator over array elements.

Consumes array upon creation and yields it's elements one-by-one.

Does not perform any cloning operations, only moves values.

Examples

use array_tools;

// Notice - this struct is neither Copy nor Clone.
#[derive(Debug, PartialEq, Eq)]
struct Foo(u32);

let array = [Foo(1), Foo(2), Foo(3)];
let mut iter = array_tools::IntoIter::new(array);
assert_eq!(iter.next(), Some(Foo(1)));
assert_eq!(iter.next(), Some(Foo(2)));
assert_eq!(iter.next(), Some(Foo(3)));
assert_eq!(iter.next(), None);

Implementations

impl<T, A> IntoIter<T, A> where
    A: FixedSizeArray<T>, 
[src]

pub fn new(array: A) -> IntoIter<T, A>

Notable traits for IntoIter<T, A>

impl<T, A> Iterator for IntoIter<T, A> where
    A: FixedSizeArray<T>, 
type Item = T;
[src]

Trait Implementations

impl<T, A> Clone for IntoIter<T, A> where
    A: FixedSizeArray<T>,
    T: Clone
[src]

impl<T, A> Debug for IntoIter<T, A> where
    A: FixedSizeArray<T>,
    T: Debug
[src]

impl<T, A> DoubleEndedIterator for IntoIter<T, A> where
    A: FixedSizeArray<T>, 
[src]

impl<T, A> Eq for IntoIter<T, A> where
    A: FixedSizeArray<T>,
    T: Eq
[src]

impl<T, A> Iterator for IntoIter<T, A> where
    A: FixedSizeArray<T>, 
[src]

type Item = T

The type of the elements being iterated over.

impl<T, A> PartialEq<IntoIter<T, A>> for IntoIter<T, A> where
    A: FixedSizeArray<T>,
    T: PartialEq
[src]

Auto Trait Implementations

impl<T, A> Send for IntoIter<T, A> where
    A: Send,
    T: Send

impl<T, A> Sync for IntoIter<T, A> where
    A: Sync,
    T: Sync

impl<T, A> Unpin for IntoIter<T, A> where
    A: Unpin,
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.