Structurevapor 4.114.1Vapor
AsyncIterator
This wrapper generalizes our implementation. RequestBody.AsyncIterator
is the override point for using another implementation
struct AsyncIterator
This wrapper generalizes our implementation. RequestBody.AsyncIterator
is the override point for using another implementation
struct AsyncIterator
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct Body
final class Request
Represents an HTTP request in an application.
var data: ByteBuffer? { get }
var description: String { get }
var string: String? { get }
func collect(max: Int? = 1 << 14) -> EventLoopFuture<ByteBuffer?>
@preconcurrency func drain(_ handler: @escaping (BodyStreamResult) -> EventLoopFuture<Void>)
func makeAsyncIterator() -> AsyncIterator
Generates an AsyncIterator
to stream the body’s content as ByteBuffer
sequences. This implementation supports backpressure using NIOAsyncSequenceProducerBackPressureStrategies
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?
typealias Element = 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.