Instance Methodswift-nio 2.72.0NIOHTTP1
write(context:data:promise:)
HTTPServerProtocolErrorHandler.swift:57func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?)
s8NIOHTTP130HTTPServerProtocolErrorHandlerC5write7context4data7promisey7NIOCore07ChannelE7ContextC_AH6NIOAnyVAH16EventLoopPromiseVyytGSgtF
What are these?
FNV24: [82L4R]
import NIOHTTP1
final class HTTPServerProtocolErrorHandler
A simple channel handler that catches errors emitted by parsing HTTP requests and sends 400 Bad Request responses.
final class ChannelHandlerContext
Every ChannelHandler
has – when added to a ChannelPipeline
– a corresponding ChannelHandlerContext
which is the way ChannelHandler
s can interact with other ChannelHandler
s in the pipeline.
struct NIOAny
NIOAny
is an opaque container for values of any type, similar to Swift’s builtin Any
type. Contrary to Any
the overhead of NIOAny
depends on the the type of the wrapped value. Certain types that are important for the performance of a SwiftNIO application like ByteBuffer
, FileRegion
and AddressEnvelope<ByteBuffer>
can be expected to be wrapped almost without overhead. All others will have similar performance as if they were passed as an Any
as NIOAny
just like Any
will contain them within an existential container.
struct EventLoopPromise<Value>
A promise to provide a result later.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
init()
func errorCaught(context: ChannelHandlerContext, error: Error)
typealias InboundIn = HTTPServerRequestPart
typealias InboundOut = HTTPServerRequestPart
typealias OutboundIn = HTTPServerResponsePart
typealias OutboundOut = HTTPServerResponsePart