achanda / ipnetwork

A library to work with CIDRs in rust
Apache License 2.0
121 stars 38 forks source link

Iterators are not public #138

Closed faern closed 3 years ago

faern commented 3 years ago

The types Ipv4NetworkIterator and Ipv6NetworkIterator are not public types in the library. But you can get them from the iter methods on the network types. They should probably be exported?

Also, these hidden iterator types implement Copy. Iterators should usually not implement Copy. Because using them becomes very confusing. Every time you pass the iterator somewhere by value it's copied and the original instance stays where it was and can still be iterated. Meaning you can use a single iterator to iterate over the "collection" many times.