CancellableResult
@frozen
public enum CancellableResult<Value>
Used to represent whether an operation was successful, was cancelled, 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) -
The operation was cancelled.
Declaration
Swift
case cancelled -
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
trueif the result indicates a cancellation,falseotherwise.Declaration
Swift
public var isCancelled: 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 }
CancellableResult Enumeration Reference