[][src]Trait ordered_iter::OrderedMapIterator

pub trait OrderedMapIterator: Iterator<Item = (Self::Key, Self::Val)> + Sized {
    type Key;
    type Val;
    fn inner_join_map<I>(self, map: I) -> InnerJoinMap<Self, I>
    where
        I: OrderedMapIterator<Key = Self::Key>
, { ... }
fn inner_join_set<I>(self, set: I) -> InnerJoinMapSet<Self, I>
    where
        I: OrderedSetIterator<Item = Self::Key>
, { ... }
fn outer_join<I>(self, other: I) -> OuterJoin<Self, I>
    where
        I: OrderedMapIterator<Key = Self::Key>
, { ... } }

Allows an iterator to do an inner join with another iterator to combine their values or filter based on their keys.

This trait is applied to an iterator over a map-like structure.

Associated Types

type Key

type Val

Loading content...

Provided methods

fn inner_join_map<I>(self, map: I) -> InnerJoinMap<Self, I> where
    I: OrderedMapIterator<Key = Self::Key>, 

Joins two ordered maps together.

fn inner_join_set<I>(self, set: I) -> InnerJoinMapSet<Self, I> where
    I: OrderedSetIterator<Item = Self::Key>, 

Filters an ordered map with an ordered set.

fn outer_join<I>(self, other: I) -> OuterJoin<Self, I> where
    I: OrderedMapIterator<Key = Self::Key>, 

Joins an ordered iterator with another ordered iterator.

The new iterator will return a key-value pair for every key in either iterator. If a key is present in both iterators, they will be returned together (two values). If a value is in other but not self, it will be returned without the value in self. If the value is in self but not other, it will be returned without the value from other.

Loading content...

Implementations on Foreign Types

impl<'a, K: Ord, V> OrderedMapIterator for Iter<'a, K, V>[src]

type Key = &'a K

type Val = &'a V

impl<K: Ord, V> OrderedMapIterator for IntoIter<K, V>[src]

type Key = K

type Val = V

impl<'a, K: Ord, V> OrderedMapIterator for IterMut<'a, K, V>[src]

type Key = &'a K

type Val = &'a mut V

impl<'a, V> OrderedMapIterator for Iter<'a, V>[src]

type Key = usize

type Val = &'a V

Loading content...

Implementors

impl<A, B> OrderedMapIterator for InnerJoinMap<A, B> where
    A: OrderedMapIterator,
    B: OrderedMapIterator<Key = A::Key>,
    A::Key: Ord
[src]

type Key = A::Key

type Val = (A::Val, B::Val)

impl<A, B> OrderedMapIterator for InnerJoinMapSet<A, B> where
    A: OrderedMapIterator,
    B: OrderedSetIterator<Item = A::Key>,
    A::Key: Ord
[src]

type Key = A::Key

type Val = A::Val

impl<A, B> OrderedMapIterator for OuterJoin<A, B> where
    A: OrderedMapIterator,
    B: OrderedMapIterator<Key = A::Key>,
    A::Key: Ord
[src]

type Key = A::Key

type Val = (Option<A::Val>, Option<B::Val>)

Loading content...