Result
@frozen
public enum Result<Value>
Used to represent whether an operation was successful or encountered an error.
-
The operation was successful, returning the associated value.
Declaration
Swift
case success(Value) -
The operation failed, with the associated value causing the failure.
Declaration
Swift
case failure(Error) -
Returns
trueif the result is a success,falseotherwise.Declaration
Swift
public var isSuccess: Bool { get } -
Returns
trueif the result is a failure,falseotherwise.Declaration
Swift
public var isFailure: Bool { get } -
Returns the associated value if the result is a success,
nilotherwise.Declaration
Swift
public var value: Value? { get } -
Returns the associated error value if the result is a failure,
nilotherwise.Declaration
Swift
public var error: Error? { get }
Result Enumeration Reference