0001    // ResponderType.swift
0002    //
0003    // The MIT License (MIT)
0004    //
0005    // Copyright (c) 2015 Zewo
0006    //
0007    // Permission is hereby granted, free of charge, to any person obtaining a copy
0008    // of this software and associated documentation files (the "Software"), to deal
0009    // in the Software without restriction, including without limitation the rights
0010    // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0011    // copies of the Software, and to permit persons to whom the Software is
0012    // furnished to do so, subject to the following conditions:
0013    //
0014    // The above copyright notice and this permission notice shall be included in all
0015    // copies or substantial portions of the Software.
0016    //
0017    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0018    // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0019    // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0020    // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0021    // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0022    // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0023    // SOFTWARE.
0024    
0025    public protocol ChainType
BranchMiddleware.swift:48
    public func respond(request: Request, chain: ChainType) throws -> Response {
MergeMiddleware.swift:40
    public func respond(request: Request, chain: ChainType) throws -> Response {
MiddlewareType.swift:26
    func respond(request: Request, chain: ChainType) throws -> Response
MiddlewareType.swift:36
    public func intercept(chain: ChainType) -> ChainType {
MiddlewareType.swift:36
    public func intercept(chain: ChainType) -> ChainType {
MiddlewareType.swift:44
    let respond: (request: Request, chain: ChainType) throws -> Response
MiddlewareType.swift:46
    public init(respond: (request: Request, chain: ChainType) throws -> Response) {
MiddlewareType.swift:50
    public func respond(request: Request, chain: ChainType) throws -> Response {
MiddlewareType.swift:56
    public func intercept(responder: ChainType) -> ChainType {
MiddlewareType.swift:56
    public func intercept(responder: ChainType) -> ChainType {
ResponderType.swift:29
public protocol ResponderType: ChainType {
{ 0026 func proceed
BranchMiddleware.swift:50
            return try truthy.intercept(chain).proceed(request)
BranchMiddleware.swift:53
                return try falsy.intercept(chain).proceed(request)
BranchMiddleware.swift:55
                return try chain.proceed(request)
MergeMiddleware.swift:41
        return try middleware.intercept(chain).proceed(request)
(request: Request) throws -> Response 0027 } 0028 0029 public protocol ResponderType
ClientType.swift:25
public protocol ClientType: ResponderType {
MiddlewareType.swift:30
    public func intercept(responder: ResponderType) -> ResponderType {
MiddlewareType.swift:30
    public func intercept(responder: ResponderType) -> ResponderType {
MiddlewareType.swift:66
    public func intercept(responder: ResponderType) -> ResponderType {
MiddlewareType.swift:66
    public func intercept(responder: ResponderType) -> ResponderType {
MiddlewareType.swift:76
    public func intercept(respond: Respond) -> ResponderType {
MiddlewareType.swift:81
public func chain(middleware middleware: MiddlewareType..., responder: ResponderType) -> ResponderType {
MiddlewareType.swift:81
public func chain(middleware middleware: MiddlewareType..., responder: ResponderType) -> ResponderType {
MiddlewareType.swift:85
public func chain(middleware middleware: MiddlewareType..., respond: Respond) -> ResponderType {
ResponderType.swift:33
extension ResponderType {
ResponderType.swift:41
public struct Responder: ResponderType {
Route.swift:25
public struct Route: ResponderType {
Route.swift:29
    public let responder: ResponderType
Route.swift:31
    public init(methods: Set<Method>, path: String, middleware: [MiddlewareType], responder: ResponderType) {
RouterType.swift:25
public protocol RouterType: ResponderType {
RouterType.swift:28
    var fallback: ResponderType { get }
ServerType.swift:29
    var responder: ResponderType { get }
: ChainType { 0030 func respond
ResponderType.swift:35
        return try respond(request)
Route.swift:39
        return try middleware.intercept(responder).respond(request)
RouterType.swift:34
        return try middleware.intercept(responder).respond(request)
(request: Request) throws -> Response 0031 } 0032 0033 extension ResponderType { 0034 public func proceed(request: Request) throws -> Response { 0035 return try respond(request) 0036 } 0037 } 0038 0039 public typealias Respond
MiddlewareType.swift:76
    public func intercept(respond: Respond) -> ResponderType {
MiddlewareType.swift:85
public func chain(middleware middleware: MiddlewareType..., respond: Respond) -> ResponderType {
ResponderType.swift:42
    let respond: Respond
ResponderType.swift:44
    public init(respond: Respond) {
= Request throws -> Response 0040 0041 public struct Responder
MiddlewareType.swift:31
        return Responder { request in
MiddlewareType.swift:37
        return Responder { request in
MiddlewareType.swift:77
        return intercept(Responder(respond: respond))
: ResponderType { 0042 let respond
ResponderType.swift:45
        self.respond = respond
ResponderType.swift:49
        return try respond(request)
: Respond 0043 0044 public init
MiddlewareType.swift:31
        return Responder { request in
MiddlewareType.swift:37
        return Responder { request in
MiddlewareType.swift:77
        return intercept(Responder(respond: respond))
(respond: Respond) { 0045 self.respond = respond 0046 } 0047 0048 public func respond(request: Request) throws -> Response { 0049 return try respond(request) 0050 } 0051 }