AsyncIterator
HTTPClientResponse.swift:81- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
struct AsyncIterator
struct AsyncIterator
import AsyncHTTPClient
This package provides simple HTTP Client library built on top of SwiftNIO.
struct Body
A representation of the response body for an HTTP response.
struct HTTPClientResponse
A representation of an HTTP response for the Swift Concurrency HTTPClient API.
init()
static func bytes(_ byteBuffer: ByteBuffer) -> HTTPClientResponse.Body
static func stream<SequenceOfBytes>(_ sequenceOfBytes: SequenceOfBytes) -> HTTPClientResponse.Body where SequenceOfBytes : Sendable, SequenceOfBytes : AsyncSequence, SequenceOfBytes.Element == ByteBuffer
func collect(upTo maxBytes: Int) async throws -> ByteBuffer
Accumulates Body
of ByteBuffer
s into a single ByteBuffer
.
func makeAsyncIterator() -> AsyncIterator
typealias Element = ByteBuffer
protocol AsyncIteratorProtocol<Element, Failure>
A type that asynchronously supplies the values of a sequence one at a time.
mutating func next() async throws -> ByteBuffer?
mutating func next(isolation actor: isolated (any Actor)?) async throws(Self.Failure) -> Self.Element?
Default implementation of next()
in terms of next()
, which is required to maintain backward compatibility with existing async iterators.