Result
public enum Result<A, B>
A result captures both successful and failed return values of a method.
-
A value representing a successful result.
Declaration
Swift
case success(A)
-
A value representing a failed result.
Declaration
Swift
case failure(B)
-
Create a successful result with the provided value.
Declaration
Swift
public init(success a: A)Parameters
asuccessful value represented by this result.
-
Create a failed result with the provided value.
Declaration
Swift
public init(failure b: B)Parameters
bfailure value represented by this result.
-
Determine whether two results containing equatable values are equal.
Declaration
Swift
public static func==(lhs: Result, rhs: Result) -> BoolParameters
lhsleft-hand result to compare.
rhsright-hand result to compare.
Return Value
trueif lhs are both successes or failures containing equal values.
-
Infix version of
See morebindreturning a value rather than a function.Declaration
Return Value
the result of
fifresultwas successful,resultotherwise.
View on GitHub
Install in Dash
Result Enumeration Reference