Failure
Represents a failed result containing an error of type E.
Value parameters
- error
-
the error value
Attributes
Members list
Value members
Inherited methods
Applies a function that returns a Result to the success value, flattening the result. This is useful for chaining operations that might fail.
Applies a function that returns a Result to the success value, flattening the result. This is useful for chaining operations that might fail.
Type parameters
- F
-
the error type of the returned Result
- U
-
the success type of the returned Result
Value parameters
- f
-
the function to apply to the success value
Attributes
- Returns
-
the result of applying f if this is a Success, or the same Failure if this is a Failure
- Inherited from:
- Result
Returns the success value if this is a Success, otherwise returns the default value.
Returns the success value if this is a Success, otherwise returns the default value.
Type parameters
- U
-
the type of the default value (must be a supertype of T)
Value parameters
- default
-
the value to return if this is a Failure
Attributes
- Returns
-
the success value or the default value
- Inherited from:
- Result
Returns true if this Result is a Failure, false otherwise.
Returns true if this Result is a Failure, false otherwise.
Attributes
- Returns
-
true if Failure, false if Success
- Inherited from:
- Result
Returns true if this Result is a Success, false otherwise.
Returns true if this Result is a Success, false otherwise.
Attributes
- Returns
-
true if Success, false if Failure
- Inherited from:
- Result
Transforms the success value using the provided function, leaving failures unchanged.
Transforms the success value using the provided function, leaving failures unchanged.
Type parameters
- U
-
the type of the transformed value
Value parameters
- f
-
the function to apply to the success value
Attributes
- Returns
-
a new Result with the transformed value if this is a Success, or the same Failure if this is a Failure
- Inherited from:
- Result
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product