'a K ](../primitive.reference.html) , [ &'a V ](../primitive.reference.html)
)

The type of the elements being iterated over.

Â§

####  type [ IntoIter
](../iter/trait.IntoIterator.html#associatedtype.IntoIter) = [ Iter
](hash_map/struct.Iter.html "struct std::collections::hash_map::Iter") <'a, K,
V>

Which kind of iterator are we turning this into?

[ source ](../../src/std/collections/hash/map.rs.html#2179-2181) Â§

####  fn [ into_iter ](../iter/trait.IntoIterator.html#tymethod.into_iter)
(self) -> [ Iter ](hash_map/struct.Iter.html "struct
std::collections::hash_map::Iter") <'a, K, V> â

Creates an iterator from a value. [ Read more
](../iter/trait.IntoIterator.html#tymethod.into_iter)

[ source ](../../src/std/collections/hash/map.rs.html#2185-2194) Â§

###  impl<'a, K, V, S> [ IntoIterator ](../iter/trait.IntoIterator.html "trait
std::iter::IntoIterator") for &'a mut [ HashMap ](hash_map/struct.HashMap.html
"struct std::collections::hash_map::HashMap") <K, V, S>

Â§

####  type [ Item ](../iter/trait.IntoIterator.html#associatedtype.Item) = ( [
&'a K ](../primitive.reference.html) , [ &'a mut V
](../primitive.reference.html) )

The type of the elements being iterated over.

Â§

####  type [ IntoIter
](../iter/trait.IntoIterator.html#associatedtype.IntoIter) = [ IterMut
](hash_map/struct.IterMut.html "struct std::collections::hash_map::IterMut")
<'a, K, V>

Which kind of iterator are we turning this into?

[ source ](../../src/std/collections/hash/map.rs.html#2191-2193) Â§

####  fn [ into_iter ](../iter/trait.IntoIterator.html#tymethod.into_iter)
(self) -> [ IterMut ](hash_map/struct.IterMut.html "struct
std::collections::hash_map::IterMut") <'a, K, V> â

Creates an iterator from a value. [ Read more
](../iter/trait.IntoIterator.html#tymethod.into_iter)

[ source ](../../src/std/collections/hash/map.rs.html#2197-2224) Â§

###  impl<K, V, S> [ IntoIterator ](../iter/trait.IntoIterator.html "trait
std::iter::IntoIterator") for [ HashMap ](hash_map/struct.HashMap.html "struct
std::collections::hash_map::HashMap") <K, V, S>

[ source ](../../src/std/collections/hash/map.rs.html#2221-2223) Â§

####  fn [ into_iter ](../iter/trait.IntoIterator.html#tymethod.into_iter)
(self) -> [ IntoIter ](hash_map/struct.IntoIter.html "struct
std::collections::hash_map::IntoIter") <K, V> â

Creates a consuming iterator, that is, one that moves each key-value pair out
of the map in arbitrary order. The map cannot be used after calling this.

#####  Â§  Examples

    
    
    use std::collections::HashMap;
    
    let map = HashMap::from([
        ("a", 1),
        ("b", 2),
        ("c", 3),
    ]);
    
    // Not possible with .iter()
    let vec: Vec<(&str, i32)> = map.into_iter().collect();

[ Run ](https://play.rust-
lang.org/?code=%23!%5Ballow\(unused\)%5D%0Afn+main\(\)+%7B%0Ause+std::collections::HashMap;%0A%0Alet+map+=+HashMap::from\(%5B%0A++++\(%22a%22,+1\),%0A++++\(%22b%22,+2\),%0A++++\(%22c%22,+3\),%0A%5D\);%0A%0A//+Not+possible+with+.iter\(\)%0Alet+vec:+Vec%3C\(%26str,+i32\)%3E+=+map.into_iter\(\).collect\(\);%0A%7D&edition=2021)

Â§

####  type [ Item ](../iter/trait.IntoIterator.html#associatedtype.Item) = [
(K, V) ](../primitive.tuple.html)

The type of the elements being iterated over.

Â§

####  type [ IntoIter
](../iter/trait.IntoIterator.html#associatedtype.IntoIter) = [ IntoIter
](hash_map/struct.IntoIter.html "struct std::collections::hash_map::IntoIter")
<K, V>

Which kind of iterator are we turning this into?

[ source ](../../src/std/collections/hash/map.rs.html#1278-1291) Â§

###  impl<K, V, S> [ PartialEq ](../cmp/trait.PartialEq.html "trait
std::cmp::PartialEq") for [ HashMap ](hash_map/struct.HashMap.html "struct
std::collections::hash_map::HashMap") <K, V, S>

where K: [ Eq ](../cmp/trait.Eq.html "trait std::cmp::Eq") \+ [ Hash
](../hash/trait.Hash.html "trait std::hash::Hash") , V: [ PartialEq
](../cmp/trait.PartialEq.html "trait std::cmp::PartialEq") , S: [ BuildHasher
](../hash/trait.BuildHasher.html "