Lazy iterator-to-cursor adapter
ID: lazy-iterator-to-cursor-adapter
Represent a cursor by an underlying consuming iterator plus an optional cached head. Without a cache, its abstract sequence is the iterator's sequence; with cached , it is concatenated with the remaining iterator sequence.
current fetches and caches exactly one value when needed, repeated reads reuse it, and advance discards it. Availability testing need not fetch a value, and construction need not query the input. This avoids forcing a future stream element that the client may never request. New to topics? Read the docs here!