MCPcopy Create free account

hub / github.com/19h/rsult / functions

Functions264 in github.com/19h/rsult

Methodor
* Returns this if Ok, otherwise returns the provided ResultAsync.
src/result-async.ts:398
Methodor
* On Ok, `or` returns self. We construct a new ResultOk with updated error type.
src/result.ts:389
Methodor
(res: Result<T, F>)
src/result.ts:561
Methodor
* Returns this if Some, otherwise returns the provided OptionAsync.
src/option-async.ts:279
MethodorElse
* Returns this if Some, otherwise evaluates the provided function.
src/option-async.ts:247
Methodor_else
* Returns `self` if `Some`, otherwise calls `fn` and returns the result.
src/option.ts:123
Methodor_else
* On Some, `or_else` returns self.
src/option.ts:382
Methodor_else
(fn: () => Option<U>)
src/option.ts:566
Methodor_else
* On Ok, `or_else` returns self. We construct a new ResultOk with updated error type.
src/result.ts:396
Methodor_else
(fn: (arg: E) => Result<T, F>)
src/result.ts:565
Methodreplace
(value: T)
src/option.ts:416
Methodreplace
* On None, replace returns Some with the provided value. * * Note: This differs from Rust's semantics where replace would mutate * self
src/option.ts:598
FunctionsyncFn
(x: number)
src/result-async.test.ts:415
Methodtake
()
src/option.ts:583
Methodtake_if
(predicate: (arg: T) => boolean)
src/option.ts:409
Methodtake_if
(_predicate: (arg: T) => boolean)
src/option.ts:587
MethodtoAsync
* Lifts this Result into a ResultAsync.
src/result-async.ts:624
MethodtoAsync
* Lifts this Option into an OptionAsync.
src/option-async.ts:449
MethodtoAsync
* Lifts this Option into an OptionAsync.
src/option-async.ts:456
MethodtoPromise
* Returns the underlying Promise.
src/result-async.ts:223
MethodtoPromise
* Returns the underlying Promise.
src/option-async.ts:152
Methodtransmute
* Type-safe transmute that narrows the error type to `never`. * * Since this is `Ok`, there's no error, so `E` can safely become `never`.
src/result.ts:230
Methodtransmute
* Type-safe transmute that narrows the value type to `never`. * * Since this is `Err`, there's no value, so `T` can safely become `never`.
src/result.ts:242
Methodtransmute
* Transmutes to Ok<T, never>, proving there's no error.
src/result.ts:430
Methodtransmute
* Transmutes to Err<never, E>, proving there's no value.
src/result.ts:595
Methodtranspose
()
src/option.ts:465
Methodtranspose
()
src/option.ts:630
Methodtranspose
* Transposes a `Result` of an `Option` into an `Option` of a `Result`. * * - `Ok(None)` → `None` * - `Ok(Some(v))` → `Some(Ok(v))`
src/result.ts:214
Methodtranspose
* Transposes Ok(Option<U>) into Option<Result<U, E>>.
src/result.ts:437
Methodtranspose
* Transposes Err(e) into Some(Err(e)). * For Err, we always return Some(Err(e)) regardless of the expected Option type.
src/result.ts:603
Methodtry
* Wraps a function that may throw, executing it and capturing the result. * * @example * ```typescript * const result = await Opti
src/option-async.ts:99
Methodunwrap
* Returns the contained `Some` value, or throws. * * @throws Error if this is `None`
src/option.ts:137
Methodunwrap
()
src/option.ts:332
Methodunwrap
()
src/option.ts:515
Methodunwrap
* Unwraps the Ok value, or throws.
src/result-async.ts:424
Methodunwrap
()
src/result.ts:365
Methodunwrap
()
src/result.ts:534
Methodunwrap
* Unwraps the Some value, or throws.
src/option-async.ts:326
MethodunwrapErr
* Unwraps the Err value, or throws.
src/result-async.ts:440
MethodunwrapOr
* Unwraps the Some value, or returns the provided default.
src/option-async.ts:334
MethodunwrapOrElse
* Unwraps the Some value, or computes a default.
src/option-async.ts:342
Methodunwrap_err
()
src/result.ts:373
Methodunwrap_err
()
src/result.ts:542
Methodunwrap_or
* Returns the contained `Some` value, or the provided default.
src/option.ts:142
Methodunwrap_or
(_optb: T)
src/option.ts:336
Methodunwrap_or
(optb: T)
src/option.ts:519
Methodunwrap_or
(_optb: T)
src/result.ts:401
Methodunwrap_or
(optb: T)
src/result.ts:570
Methodunwrap_or_default
()
src/option.ts:344
Methodunwrap_or_default
()
src/option.ts:527
Methodunwrap_or_else
* Returns the contained `Some` value, or computes it from `fn`.
src/option.ts:147
Methodunwrap_or_else
(_fn: () => T)
src/option.ts:340
Methodunwrap_or_else
(fn: () => T)
src/option.ts:523
Methodunwrap_or_else
(_fn: (arg: E) => T)
src/result.ts:405
Methodunwrap_or_else
(fn: (arg: E) => T)
src/result.ts:574
Methodunzip
()
src/option.ts:460
Methodunzip
()
src/option.ts:626
Methodxor
(optb: Option<T>)
src/option.ts:386
Methodxor
(optb: Option<T>)
src/option.ts:570
Methodzip
(other: Option<U>)
src/option.ts:423
Methodzip
(_other: Option<U>)
src/option.ts:603
Methodzip
* Zips this OptionAsync with another.
src/option-async.ts:389
Methodzip_with
(other: Option<U>, f: (val: T, other: U) => R)
src/option.ts:430
Methodzip_with
(_other: Option<U>, _f: (val: T, other: U) => R)
src/option.ts:607
← previous201–264 of 264, ranked by callers