ResponseModifier
public final class ResponseModifier<E: RestEndpoint, R: CorvusResponse>:
RestEndpoint where E.Element == R.Item
A class that wraps a component which utilizes a .respond(with:) modifier.
That allows Corvus to chain modifiers, as it gets treated as any other
struct conforming to RestEndpoint.
-
The subject of an operation’s queries in its
.query()method.Declaration
Swift
public typealias QuerySubject = E.QuerySubject -
The Element that is returned by the handler.
Declaration
Swift
public typealias Element = R -
The HTTP method of the functionality of the component.
Declaration
Swift
public let operationType: OperationType -
An array of
PathComponentdescribing the path that theTypedEndpointextends.Declaration
Swift
public let pathComponents: [PathComponent] -
A method which transform the restEndpoints’s handler return value to a
Response.Throws
AnAborterror if something goes wrong.Declaration
Swift
public func handler(_ req: Request) throws -> EventLoopFuture<Element>Parameters
reqAn incoming
Request.Return Value
An
EventLoopFuturecontaining theResponseModifier‘sResponse.
ResponseModifier Class Reference