Result
public enum Result<SuccessType>
Used to represent whether an operation was successful or encountered an error.
-
Indicates the operation was successful and resulted in the provided associated value.
Declaration
Swift
case success(SuccessType)
-
Indicates the parsing operation failed and resulted in the provided associated error value.
Declaration
Swift
case failure(Error)
-
Returns
trueif the result is a success,falseotherwise.Declaration
Swift
public var isSuccess: Bool -
Returns
trueif the result is a failure,falseotherwise.Declaration
Swift
public var isFailure: Bool -
Returns the assoicated value if the result is a success,
nilotherwise.Declaration
Swift
public var value: SuccessType? -
Returns the associated error value if the result is a failure,
nilotherwise.Declaration
Swift
public var error: Error?
View on GitHub
Install in Dash
Result Enum Reference