Expand description

Versions of FlatMap and Flatten that know their inner iterators’ size in advance. Note that core & std already provide this functionality for some types through a hack using specialization. This crate’s contribution is that the trait ConstSizeIntoIterator is public and the functionality is therefore extensible.

To use, just use const_size_flatten::IteratorExtension.

Structs

Traits

  • Implementors of this trait promise that all iterators they produce always produce the same number of elements. This number is given by the associated constant SIZE. Note that this trait should not be implemented for Iterators, since they can be iterated through, which changes the amount of elements they produce.
  • Convenience trait that allows you to construct ConstSizeFlatten and ConstSizeFlatMap. This trait is sealed, you cannot implement it.

Functions