RestModifier
public class RestModifier<R> : RestEndpoint where R : RestEndpoint
A class that wraps a RestEndpoint with additional functionalty.
This allows Corvus to chain modifiers, as it gets treated as any other
struct conforming to RestEndpoint.
-
The return value of the
.query(), so the type being operated on in the current component.Declaration
Swift
public typealias QuerySubject = R.QuerySubject -
The return type for the
.handler()modifier.Declaration
Swift
public typealias Element = R.Element -
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 default implementation of
.query()for components that do not require customized database queries.Throws
An error if something goes wrong.Declaration
Swift
public func query(_ req: Request) throws -> QueryBuilder<R.QuerySubject>Parameters
reqThe incoming
Request.Return Value
A
QueryBuilderobject for further querying. -
Declaration
Swift
public func handler(_ req: Request) throws -> EventLoopFuture<Element>
RestModifier Class Reference