[][src]Struct mofurun::sorted_vec::SortedVecIterator

pub struct SortedVecIterator<T> { /* fields omitted */ }

Trait Implementations

impl<T: Debug> Debug for SortedVecIterator<T>[src]

impl<Ty> Iterator for SortedVecIterator<Ty>[src]

type Item = Ty

The type of the elements being iterated over.

fn next(&mut self) -> Option<Ty>[src]

Returns the current element and marches the iterator forward. This operation is O(1).

Example

assert_eq!(Some(1), SortedVec::default().push(1).push(3).push(5).push(7).push(44).into_iter().next());

fn count(self) -> usize where
    Self: Sized
[src]

Returns the number of elements inside this iterator. This operation is O(1).

Example

assert_eq!(5, SortedVec::default().push(1).push(3).push(5).push(7).push(44).into_iter().count());

fn last(self) -> Option<Self::Item> where
    Self: Sized
[src]

Returns the last element inside a SortedVec. This operation is O(1).

Example

assert_eq!(Some(44), SortedVec::default().push(1).push(3).push(5).push(7).push(44).into_iter().last());

fn nth(&mut self, n: usize) -> Option<Self::Item>[src]

Returns the nth element inside a SortedVec. This operation is O(1).

Example

assert_eq!(Some(7), SortedVec::default().push(1).push(3).push(5).push(7).push(10).into_iter().nth(3));

fn max(self) -> Option<Self::Item> where
    Self: Sized,
    Self::Item: Ord
[src]

Returns the max element inside a SortedVec. This operation is O(1).

Example

assert_eq!(Some(10), SortedVec::default().push(1).push(3).push(5).push(7).push(10).into_iter().max());

fn min(self) -> Option<Self::Item> where
    Self: Sized,
    Self::Item: Ord
[src]

Returns the min element inside a SortedVec. This operation is O(1).

Example

assert_eq!(Some(1), SortedVec::default().push(1).push(3).push(5).push(7).push(10).into_iter().min());

Auto Trait Implementations

impl<T> RefUnwindSafe for SortedVecIterator<T> where
    T: RefUnwindSafe

impl<T> !Send for SortedVecIterator<T>

impl<T> !Sync for SortedVecIterator<T>

impl<T> Unpin for SortedVecIterator<T>

impl<T> UnwindSafe for SortedVecIterator<T> where
    T: RefUnwindSafe

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.