Represents a successful result.
This class is used as the success branch of Result. It stores the produced value and exposes type guards for narrowing the result.
The value type carried by the successful result.
The error type kept for compatibility with the Result union.
Result
Creates a successful result with the provided value.
The value produced by the successful operation.
Readonly
Returns true when this instance represents a failed result.
true
This is always false for Ok.
false
Returns true when this instance represents a successful result.
This method is intended for type narrowing when handling a Result.
Represents a successful result.
This class is used as the success branch of Result. It stores the produced value and exposes type guards for narrowing the result.