Successful Result variant.
Result
Creates a successful result holding value.
value
Optional
Readonly
The error value when present.
true when this instance is an Ok.
true
The success value when present.
Chains computations that may fail.
If this is Ok, calls fn with the current value. If this is Err, propagates the error unchanged.
Ok
fn
Err
Type guard for narrowing to Err.
Type guard for narrowing to Ok.
Transforms the success value while preserving the error type.
If this is Err, the error is propagated unchanged.
Transforms the error value while preserving the success type.
If this is Ok, the value is propagated unchanged.
Exhaustively handles both variants and returns a shared result type.
Recovers from an error by mapping Err<E> to Result<T, F>.
Err<E>
Result<T, F>
If this is Ok, the value is preserved.
Returns the success value.
ResultError if called on an Err.
Returns the success value, or defaultValue if this is an Err.
defaultValue
Static
Collects an array of results into a single result.
Returns the first Err encountered, or Ok<T[]> when all succeed.
Ok<T[]>
Async overload of BaseResult.all.
Returns the first successful result.
If all results are errors, returns the last encountered Err.
Async overload of BaseResult.any.
Successful
Resultvariant.