Represents a failed result containing an error. This class indicates that an operation failed with specific error information.
The type of the success value (for type compatibility)
The type of the error object
Creates a new Err result.
The error information to store
The RnException instance created from the error
Protected
Optional
The value to store (either success value or error)
Returns this Err result unchanged since the operation already failed. The chaining function is not called.
The type of the new success value
Chaining function (not called for Err results)
This Err result cast to the new type
Always returns false for Err results.
Always false
This method seems to be unused
Gets the contained error information.
The RnError object containing error details
Type guard indicating this is an Err result.
Always true for Err instances
Type guard indicating this is not an Ok result.
Always false for Err instances
Pattern matching implementation for Result types.
The type of the return value from the Ok function
The type of the new error object
Object containing pattern matching functions
Function to execute if this result is Err
Function to execute if this result is Ok
A new Result containing the result of the pattern matching
If the result is neither Ok nor Err
Gets the name of this result class.
The constructor name ('Ok' or 'Err')
Provides an alternative result since this result failed. Calls the provided function to get an alternative result.
The type of the alternative success value
Function that provides an alternative result
The result of the alternative function
Converts this error to a string representation.
The stack trace from the contained exception
Throws an exception since this result contains an error.
Never returns (always throws)
Always throws the contained exception
Calls the compensation function to provide a fallback value.
Function that provides a fallback value based on the error
The compensated value from the catch function
Represents a failed result containing an error. This class indicates that an operation failed with specific error information.