pub fn iter(&self) -> GroupedCollectionIter<KeyType, ValueType> {
        let mut keys = self.groups.keys().collect::<Vec<&KeyType>>();
        keys.sort();
        GroupedCollectionIter {
            collection: &self,
            keys,
            current: 0,
        }
    }
/// Returns an iterator over the groups in the collection that will iterate over groups
/// in sort order according to their keys.
///
/// # Examples
///
/// ```
/// # use groupby::grouped_collection::*;
/// let mut coll = GroupedCollection::new();
///
/// let entries = [
///     ("Types of hats",   "Fedoras"),
///     ("Favorite fruits", "Bananas"),
///     ("Favorite fruits", "Apples")
/// ];
/// for (k, v) in &entries {
///     coll.add(k.to_string(), v.to_string());
/// }
///
/// let expected_fruits = (
///     "Favorite fruits".to_string(),
///     vec!["Bananas".to_string(), "Apples".to_string()]
/// );
/// let expected_hats = (
///     "Types of hats".to_string(),
///     vec!["Fedoras".to_string()]
/// );
/// let mut iter = coll.iter();
/// assert_eq!(Some((&expected_fruits.0, &expected_fruits.1)), iter.next());
/// assert_eq!(Some((&expected_hats.0, &expected_hats.1)), iter.next());
/// assert_eq!(None, iter.next());
/// ```
Returns an iterator over the groups in the collection that will iterate over groups
in sort order according to their keys.
Returns an iterator over the groups in the collection that will iterate over groups in sort order according to their keys .
pub fn iter(&self) -> GroupedCollectionIter<KeyType, ValueType> {
        let mut keys = self.groups.keys().collect::<Vec<&KeyType>>();
        keys.sort();
        GroupedCollectionIter {
            collection: &self,
            keys,
            current: 0,
        }
    }
pub fn iter ( & self ) -> GroupedCollectionIter < KeyType , ValueType > { let mut keys = self . groups . keys ( ) . collect :: < Vec < & KeyType > > ( ) ; keys . sort ( ) ; GroupedCollectionIter { collection : & self , keys , current : 0 , } }
Returns an iterator over the groups in the collection that will iterate over groups
in sort order according to their keys.
Returns an iterator over the groups in the collection that will iterate over groups in sort order according to their keys .
&self
&self
examples
None
use groupby::grouped_collection::*;
let mut coll = GroupedCollection::new().

let entries = [
("Types of hats",   "Fedoras"),
("Favorite fruits", "Bananas"),
("Favorite fruits", "Apples")
];
for (k, v) in &entries {
coll.add(k.to_string(), v.to_string());
}

let expected_fruits = (
"Favorite fruits".to_string(),
vec!["Bananas".to_string(), "Apples".to_string()]
);
let expected_hats = (
"Types of hats".to_string(),
vec!["Fedoras".to_string()]
);
let mut iter = coll.iter();
assert_eq!(Some((&expected_fruits.0, &expected_fruits.1)), iter.next());
assert_eq!(Some((&expected_hats.0, &expected_hats.1)), iter.next());
assert_eq!(None, iter.next());
```
let mut coll = GroupedCollection :: new () . let entries = [ ( " Types of hats " " Fedoras " ) ( " Favorite fruits " " Bananas " ) ( " Favorite fruits " " Apples " ) ] ; for ( k v ) in &entries { coll . add ( k . to_string () v . to_string () ) ; } let expected_fruits = ( " Favorite fruits " . to_string () vec! [ " Bananas " . to_string () " Apples " . to_string () ] ) ; let expected_hats = ( " Types of hats " . to_string () vec! [ " Fedoras " . to_string () ] ) ; let mut iter = coll . iter () ; assert_eq! ( Some (( &expected_fruits . 0 &expected_fruits . 1 )) iter . next () ) ; assert_eq! ( Some (( &expected_hats . 0 &expected_hats . 1 )) iter . next () ) ; assert_eq! ( None iter . next () ) ; ` ` `