Build groups of items from the input stream. A group finishes when
belong, being passed the previous and new item, returns
false. Each group is first collected in a Vec, then passed to the
construct function as a mutable reference via an Option (which
is always Some), and the return value becomes the item in the
resulting sequence. The reason the vector is passed via Option
is so that construct can take it out via .take().unwrap() if
it wishes; if it does, group creates a new Vec for the next
group, otherwise it reuses the old one for efficiency.
The resulting iterator is empty (no group is reported) if the
input is empty.
Same as group but handles errors in the input stream, making it
easier to use (and more efficient?) than group in that case. Also,
continues building the group, so in case the receiver of the
output stream continues to read past errors, they will still
receive groups, and erros do not break up groups (this would not
be possible to achieve via group).