1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mod ip;
pub use ip::*;
pub use ip::v4::*;
pub use ip::v6::*;

mod port;
pub use port::*;

mod socket;
pub use socket::*;

/// Conversion into a smart `Iterator`.
///
/// A smart iterator is an iterator that does not store all the items in memory. It's usefull for long series.
///
/// By implementing `IntoSmartIterator` for a type, you define how it will be converted to an smart iterator.
///
/// This is common for types which describe a followed collection of some kind.
pub trait IntoSmartIterator {
    /// The type of the elements being iterated over.
    type Item;

    /// Which kind of iterator are we turning this into?
    type IntoSmartIter: Iterator;

    /// Creates an iterator from the current struct.
    fn into_smart_iter (self) -> Self::IntoSmartIter;
}