AsyncIterator
An asynchronous iterator that produces the messages of this asynchronous sequence.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
struct AsyncIteratorAn asynchronous iterator that produces the messages of this asynchronous sequence.
struct AsyncIteratorimport SwiftProtobufSupport library for Swift code generated by protoc-gen-swift.
struct AsyncMessageSequence<Base, M> where Base : AsyncSequence, M : Message, Base.Element == UInt8An asynchronous sequence of messages decoded from an asynchronous sequence of bytes.
init(base: Base, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) Reads size-delimited messages from the given sequence of bytes. Delimited format allows a single file or stream to contain multiple messages. A delimited message is a varint encoding the message size followed by a message of exactly that size.
func makeAsyncIterator() -> AsyncMessageSequence<Base, M>.AsyncIterator Creates the asynchronous iterator that produces elements of this asynchronous sequence.
typealias Element = MThe message type in this asynchronous sequence.
protocol AsyncIteratorProtocol<Element, Failure>A type that asynchronously supplies the values of a sequence one at a time.
mutating func next() async throws -> M? Asynchronously advances to the next message and returns it, or ends the sequence if there is no next message.
mutating func next() async throws(Self.Failure) -> Self.Element? Default implementation of next() in terms of next(isolation:), which is required to maintain backward compatibility with existing async iterators.
mutating func next(isolation actor: isolated (any Actor)?) async throws(Self.Failure) -> Self.Element? Default implementation of next(isolation:) in terms of next(), which is required to maintain backward compatibility with existing async iterators.