Structurehummingbird 2.1.0HummingbirdRouter
RouterBuilder
Router built using a result builder
RouterBuilder.swift:30struct RouterBuilder<Context, Handler> where Context : RouterRequestContext, Context == Handler.Context, Handler : MiddlewareProtocol, Handler.Input == Request, Handler.Output == Response
Citizens in HummingbirdRouter
Conformances
protocol MiddlewareProtocol<Input, Output, Context>
Middleware protocol with generic input, context and output types
protocol Sendable
Typealiases
Type members
init(context: Context.Type, options: RouterBuilderOptions, builder: () -> Handler
) Initialize RouterBuilder with contents of result builder
Instance members
func handle(Input, context: Context, next: (Input, Context) async throws -> Output
) async throws -> Output Process HTTP request and return an HTTP response
Citizens in HummingbirdRouter
where Context:RouterRequestContext, Context == Handler.Context, Handler:MiddlewareProtocol, Handler.Input == Request, Handler.Output == Response
Conformances
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Escapable
protocol HTTPResponder<Context>
Protocol for object that produces a response given a request
protocol HTTPResponderBuilder
A type that has a single method to build a HTTPResponder