pub const fn lex_union2s<X, I: Iterator<Item = X>, Y, J: Iterator<Item = Y>>(
    xs: I,
    ys: J
) -> LexUnion2s<X, I, Y, J>Notable traits for LexUnion2s<X, I, Y, J>impl<X, I: Iterator<Item = X>, Y, J: Iterator<Item = Y>> Iterator for LexUnion2s<X, I, Y, J> type Item = Union2<X, Y>;
Expand description

This documentation applies not only to lex_union2s, but also to lex_union3s, lex_union4s, and so on. See exhaustive_unions for more information.

Generates all $n$-unions with elements from $n$ iterators, in lexicographic order.

The order is lexicographic with respect to the order of the element iterators. All of the first variant’s elements are generated first, followed by the second variant’s elements, and so on. This means that all of the iterators, except possibly the last one, must be finite. For functions that support multiple infinite element iterators, try exhaustive_union[n]s.

If the last iterator is finite, the output length is the sum of the lengths of all the input iterators. If the last iterator is infinite, the output is also infinite.

If all of the input iterators are empty, the output is also empty.

Examples

See here.