Result

public enum Result<Value>

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.

  • 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