+/// `AnyMap` iterator.
+#[stable]
+#[derive(Clone)]
+pub struct Iter<'a> {
+ inner: hash_map::Iter<'a, TypeId, Box<Any + 'static>>,
+}
+
+/// `AnyMap` mutable references iterator.
+#[stable]
+pub struct IterMut<'a> {
+ inner: hash_map::IterMut<'a, TypeId, Box<Any + 'static>>,
+}
+
+/// `AnyMap` draining iterator.
+#[unstable = "matches collection reform specification, waiting for dust to settle"]
+pub struct Drain<'a> {
+ inner: hash_map::Drain<'a, TypeId, Box<Any + 'static>>,
+}
+
+/// `AnyMap` move iterator.
+#[stable]
+pub struct IntoIter {
+ inner: hash_map::IntoIter<TypeId, Box<Any + 'static>>,
+}
+
+#[stable]
+impl<'a> Iterator for Iter<'a> {
+ type Item = &'a Any;
+
+ #[inline]
+ fn next(&mut self) -> Option<&'a Any> {
+ self.inner.next().map(|item| &**item.1)
+ }
+
+ #[inline]
+ fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
+}
+
+#[stable]
+impl<'a> Iterator for IterMut<'a> {
+ type Item = &'a mut Any;
+
+ #[inline]
+ fn next(&mut self) -> Option<&'a mut Any> {
+ self.inner.next().map(|item| &mut **item.1)
+ }
+
+ #[inline]
+ fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
+}
+
+#[stable]
+impl<'a> Iterator for Drain<'a> {
+ type Item = Box<Any + 'static>;
+
+ #[inline]
+ fn next(&mut self) -> Option<Box<Any + 'static>> {
+ self.inner.next().map(|item| item.1)
+ }
+
+ #[inline]
+ fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
+}
+
+#[stable]
+impl Iterator for IntoIter {
+ type Item = Box<Any + 'static>;
+
+ #[inline]
+ fn next(&mut self) -> Option<Box<Any + 'static>> {
+ self.inner.next().map(|item| item.1)
+ }
+
+ #[inline]
+ fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
+}
+