ExitCase

public enum ExitCase<E>

Describes the outcome of an operation on a resource.

  • completed: The operation was completed successfully.
  • canceled: The operation was canceled.
  • error: The operation finished with an error.
  • Undocumented

    Declaration

    Swift

    case completed
  • Undocumented

    Declaration

    Swift

    case canceled
  • Undocumented

    Declaration

    Swift

    case error(E)
  • Applies a function based on the content of this value.

    Declaration

    Swift

    public func fold<A>(
        _ ifCompleted: () -> A,
        _ ifCanceled: () -> A,
        _ ifError: (E) -> A) -> A

    Parameters

    ifCompleted

    Function to be applied if this value is completed.

    ifCanceled

    Function to be applied if this value is canceled.

    ifError

    Function to be applied if this value is errored.

    Return Value

    Result of applying the corresponding function based on the content of this value.

  • Declaration

    Swift

    public var description: String { get }