[][src]Struct mofurun::sorted_vec::SortedVec

pub struct SortedVec<T>(_);

Implementations

impl<T> SortedVec<T>[src]

Original functions.

pub fn push(self, item: T) -> UnsortedVec<T>[src]

Pushes an element into the vector and returns an UnsortedVec variant of this vector.

Example

let mut sorted = SortedVec::default().push(1).push(2).push(3).push(4).push(5).sort().into_iter();
assert_eq!(sorted.next(), Some(1));
assert_eq!(sorted.next(), Some(2));
assert_eq!(sorted.next(), Some(3));
assert_eq!(sorted.next(), Some(4));
assert_eq!(sorted.next(), Some(5));

Trait Implementations

impl<T> AsRef<[T]> for SortedVec<T>[src]

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

impl<T: Default> Default for SortedVec<T>[src]

impl<T: Eq> Eq for SortedVec<T>[src]

impl<T> IntoIterator for SortedVec<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = SortedVecIterator<Self::Item>

Which kind of iterator are we turning this into?

impl<T: PartialEq> PartialEq<SortedVec<T>> for SortedVec<T>[src]

impl<T> StructuralEq for SortedVec<T>[src]

impl<T> StructuralPartialEq for SortedVec<T>[src]

impl<T> TryFrom<Vec<T>> for SortedVec<T> where
    T: PartialEq + PartialOrd
[src]

type Error = &'static str

The type returned in the event of a conversion error.

fn try_from(from: Vec<T>) -> Result<SortedVec<T>, &'static str>[src]

Tries to create a SortedVec from a Vec.

Example

let sorted : SortedVec<i32> = SortedVec::try_from(vec![1,2,3,4,5,6])?;

Auto Trait Implementations

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

impl<T> Send for SortedVec<T> where
    T: Send

impl<T> Sync for SortedVec<T> where
    T: Sync

impl<T> Unpin for SortedVec<T> where
    T: Unpin

impl<T> UnwindSafe for SortedVec<T> where
    T: UnwindSafe

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.