Result

public enum Result<Type> where Type : Decodable, Type : Encodable
extension Result: Codable

The Result represents a possible result expecting any given type.

  • An error occured.

    Declaration

    Swift

    case error(NSError)
  • The successful result itself

    Declaration

    Swift

    case result(Type)
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Creates an returns a not-found (404) result for the given request.

    Declaration

    Swift

    public static func notFound(for request: URLRequest) -> Result<Response>

    Parameters

    request

    The request.

    Return Value

    The not-found Result for the given request.