custom : state, [Known(U64), Unknown], (state => Try((item, state), [NoMore])) -> Stream(item)
Build a lazy, effectful stream from a seed; the effectful counterpart of Iter.custom.
Each pull runs advance! exactly once: Ok((item, next_state)) yields item and
continues from next_state, while Err(NoMore) ends the stream. Building the
stream runs no effects. Known(n) promises exactly n items; sources whose length
is only discovered by reading (files, stdin, sockets) use Unknown. A source that
yields more items than its Known count reports Unknown from then on.
Source errors belong in item (e.g. Try(List(U8), ReadErr)). To stop after an
error, yield it paired with a terminal state that holds no resource, so the
resource is released rather than retained by the rest of the stream.