Result

public enum Result<Value, Error: ErrorType>

Used to represent whether a request was successful or encountered an error.

  • Success: The request and all post processing operations were successful resulting in the serialization of the provided associated value.
  • Failure: The request encountered an error resulting in a failure. The associated values are the original data provided by the server as well as the error that caused the failure.
  • Undocumented

    Declaration

    Swift

    public enum Result<Value, Error: ErrorType>
  • Undocumented

    Declaration

    Swift

    public enum Result<Value, Error: ErrorType>
  • Returns true if the result is a success, false otherwise.

    Declaration

    Swift

    public var isSuccess: Bool
  • Returns true if the result is a failure, false otherwise.

    Declaration

    Swift

    public var isFailure: Bool
  • Returns the associated value if the result is a success, nil otherwise.

    Declaration

    Swift

    public var value: Value?
  • Returns the associated error value if the result is a failure, nil otherwise.

    Declaration

    Swift

    public var error: Error?
  • The textual representation used when written to an output stream, which includes whether the result was a success or failure.

    Declaration

    Swift

    public var description: String
  • The debug textual representation used when written to an output stream, which includes whether the result was a success or failure in addition to the value or error.

    Declaration

    Swift

    public var debugDescription: String