FailableResult

public enum FailableResult<T> : FailableResultProtocol

An enum containing the result of an operation which might fail.

  • success: The operation was successful.
  • failure: The operation was not successful.
  • let.success:: The result T of the operation.
  • let.failure:: The error describing the failure.
  • T

    Declaration

    Swift

    public enum FailableResult<T> : FailableResultProtocol
  • If self is .success returns value of type T Else if self is .failure throws error of

    Throws

    An error if the value could not be returned.

    Declaration

    Swift

    public func value() throws -> T

    Return Value

    The contained value

  • implement functor API

    See more

    Declaration

    Swift

    public func map<R>(_ transform: (T) throws -> R) -> FailableResult<R>
    • success: The operation was successful.
    • let.success:: The result T of the operation.

    Declaration

    Swift

    case success(T)
    • failure: The operation was not successful.
    • let.failure:: The error describing the failure.

    Declaration

    Swift

    case failure(Swift.Error)