Derive Macro trait_based_collection_macros::IntoIterator
source · [−]#[derive(IntoIterator)]
Expand description
This macro is used to derive the IntoIterator
a standard implementation for all the data
structures that implement the Collection
trait. This macro will create a generic wrapper
around the data structure and then use some of the Collection
methods to iterate over the
elements of the data structure.
The wrapper will implement the Iterator
and ExactSizeIterator
traits and will be
returned by the into_iter
method of the data structure.
So by implementing this macro, the user can ensure that one of the methods of Iterators
is
implemented for the data structure.
Panics
This macro will panic if the input could not be properly parsed using the syn
crate.