Struct sorted::Sorted [] [src]

pub struct Sorted<'a, T: 'a, O: 'a> { /* fields omitted */ }

Guarantees that the inner container is sorted in a specific order.

The Sortable trait is a requirement for all containers T being wrapped with Sorted<T> to enforce certain guarantees for operations that arent strictly read only (i.e creating iterators). See the documentation of Sortable for details.

Methods

impl<'a, T, O> Sorted<'a, T, O>
[src]

Builds a sorted collection of type T from a sorted iterator.

As the [RetainsOrder] trait is required to be implemented for T, it's guaranteed that the order of the input iterator is preserved. Since the iterator must implement IsSorted, you'll safely get a sorted collection.

impl<'a, T, O> Sorted<'a, T, O> where
    T: Sortable,
    O: SortOrder<T::Item>, 
[src]

impl<'a, T, O> Sorted<'a, T, O> where
    T: SearchableByOrder<O>,
    O: SortOrder<T::Item>, 
[src]

impl<'a, T, O> Sorted<'a, T, O> where
    T: Sortable + SortedInsert<O>,
    O: SortOrder<T::Item>, 
[src]

impl<'a, T, O> Sorted<'a, T, O>
[src]

Similar to Option::as_ref. It's mapping the inner type with AsRef.

Trait Implementations

impl<'a, T, O> Deref for Sorted<'a, T, O>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a, T, O> IsSorted for Sorted<'a, T, O>
[src]

impl<'a, T, O> IntoIterator for Sorted<'a, T, O> where
    T: IntoIterator<Item = <T as Collection>::Item> + Sortable
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more