The error value type.
Transforms the error value if this is an Err result, using a function that returns another Result.
This method is useful for recovering from failures and flattening chains of results that operate on errors.
If this is an Ok result, its success value is preserved unchanged.
Transforms the error value if this is an async Err result, using a function that returns another Result.
This method is useful for recovering from failures and flattening chains of async results that operate on errors.
If this is an async Ok result, its success value is preserved unchanged.
Transforms the success value if this is an async Ok result, using a raw value.
Example:
// getCores(): Promise<Result<number, Error>
// adjustCores(n): Promise<number>
const r = Res.from(getCores()).mapAsync((n) => adjustCores(n));
// r: AsyncResult<number, Error>
If this is an Err result, its error value is preserved unchanged.
Represents a failed result containing an error of type
E.