Iterator

public struct Iterator : AsyncIteratorProtocol

The pull-based iterator that fetches documents in bounded batches.

  • next() Asynchronous

    Advances to the next document and returns it.

    When the current batch is exhausted, the next batch is fetched from the storage engine. When all shards are exhausted, returns nil.

    Throws

    NyaruError.decodingFailed if a stored document cannot be decoded as T.

    Declaration

    Swift

    public mutating func next() async throws -> T?

    Return Value

    The next decoded document, or nil at the end of the collection.