Result

public enum Result<Value>

Result type

  • Success

    Declaration

    Swift

    case success(Value)
  • Failure

    Declaration

    Swift

    case failure(Error)
  • 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?