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
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 assoicated value if the result is a success,
nil
otherwise.Declaration
Swift
public var value: SuccessType?
-
Returns the associated error value if the result is a failure,
nil
otherwise.Declaration
Swift
public var error: Error?