Initializerhummingbird 2.3.0HummingbirdCore
init
Initialise empty ResponseBody
ResponseBody.swift:47init()
Other members in extension
Type members
init<BufferSequence>(asyncSequence: BufferSequence
) Initialise ResponseBody with an AsyncSequence of ByteBuffers
init(byteBuffer: ByteBuffer
) Initialise ResponseBody that contains a single ByteBuffer
init(contentLength: Int?, @escaping (inout any ResponseBodyWriter) async throws -> Void
) Initialise ResponseBody with closure writing body contents.
init<BufferSequence>(contentsOf: BufferSequence
) Initialise ResponseBody that contains a sequence of ByteBuffers
Instance members
let contentLength: Int?
func map(@escaping (ByteBuffer) async throws -> ByteBuffer
) -> ResponseBody Returns a ResponseBody containing the results of mapping the given closure over the sequence of ByteBuffers written.
func withPostWriteClosure(@escaping () async -> Void
) -> ResponseBody Create new response body that calls a closure once original response body has been written to the channel
func write(consuming any ResponseBodyWriter
) async throws