Success (Ok) payload type.
Enables yield* res inside a result.gen body — the equivalent of Rust's
? operator.
On Ok, yield* produces no yields and evaluates to the contained value.
On Err, it yields the Err itself, which the surrounding
result.gen / genSync / genAsync driver returns by reference
(short-circuiting the rest of the body). Not meant to be iterated by
anything other than those drivers.
Returns res if this result is Ok, otherwise returns this Err.
res is evaluated eagerly; prefer andThen when it comes from a function
call that should run only after Ok.
Second result to return when this result is Ok.
res on Ok, or this on Err.
Returns the contained Ok value.
Prefer narrowing (isOk / isErr) or non-throwing helpers (unwrapOr,
unwrapOrElse) when the Err case is expected.
The success value.
Calls fn with the contained Ok value, then returns this unchanged.
Callbacks receive DeepReadonly views (compile-time only; no runtime freeze).
Side effect for the success value; not called on Err.
this (for chaining).
Calls fn with the contained Err value, then returns this unchanged.
this (for chaining).
Maps Result<T, E> to Result<T, F> by applying fn to the contained Err
value, leaving an Ok untouched.
A new Result with the mapped Err value, or the original Ok.
Maps a Result to U by applying onErr to a contained Err value, or onOk
to a contained Ok value.
Returns res if this result is Err, otherwise returns this Ok.
res is evaluated eagerly; prefer orElse for lazy fallbacks.
this on Ok, or res on Err.
Calls fn if this result is Err, otherwise returns this Ok.
The Result from fn, or this on Ok.
Returns the contained Err value.
The error value.
Returns the contained Ok value, or computes it from the Err value.
T on Ok, otherwise the value returned by fn.
Method contract shared by Ok and Err, aligned with Rust
std::result::Result.Result<T, E>is either success (Ok(T)) or failure (Err(E)). Implementations mirror the Rust combinator names and semantics; on failure,expect/unwrap/unwrapErrthrow a JavaScriptErrorinstead of panicking.See
https://doc.rust-lang.org/std/result/enum.Result.html