The part seems1 too big to fit in the buffer, one of the future reads will
terminate or End1 it.
You can examine it and decide if you want to ignore it by skipping to after the next
Terminal, or keep it by allocating a Vec for it or the like.
1 It’s possible that the next read will find the separator or EOF immediately,
in which case we’d want to yield Terminal, but we couldn’t determine
that before reading again.
When we find the separator, the next piece will be a Terminal of an
empty slice.
When we find EOF, the next piece will be End.
E.g. terminal past read:
let mut s = Split::<3,_>::bytes_lines(b"aaa\n");
assert_eq!(s.next_piece()?, Piece::Partial(b"aaa".as_ref()));
assert_eq!(s.next_piece()?, Piece::Terminal(b"".as_ref()));
assert_eq!(s.next_piece()?, Piece::End);
E.g. EOF past read:
let mut s = Split::<3,_>::bytes_lines(b"aaa");
assert_eq!(s.next_piece()?, Piece::Partial(b"aaa".as_ref()));
assert_eq!(s.next_piece()?, Piece::End);