The type of the value to be contained in the Ok result.
The type of the error that the result could potentially contain (not used in this case).
The value to wrap as an Ok result.
A Result<T, E> that contains the provided value, representing the Ok case.
Creates a Result<void, E> representing a successful outcome with no value.
This overload is used when the operation succeeds but doesn't produce a meaningful value.
In Rust, this would be Ok(()) using the unit type ().
Since JavaScript doesn't have a unit type, we use void instead.
The type of the error that the result could potentially contain.
A Result<void, E> representing a successful operation with no value.
Creates a
Result<T, E>representing a successful outcome containing a value. This function is used to construct aResultthat signifies the operation was successful by containing the valueT.