Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/19h/rsult
/ functions
Functions
264 in github.com/19h/rsult
⨍
Functions
264
◇
Types & classes
38
Method
and
* On None, `and` returns None with updated type parameter.
src/option.ts:551
Method
and
* Returns the provided ResultAsync if this is Ok, otherwise returns this Err.
src/result-async.ts:384
Method
and
(res: Result<U, E>)
src/result.ts:378
Method
and
* On Err, `and` returns self. We construct a new ResultErr with updated value type.
src/result.ts:550
Method
and
* Returns the provided OptionAsync if this is Some, otherwise returns None.
src/option-async.ts:265
Method
andThen
* Chains a function that returns an Option or OptionAsync.
src/option-async.ts:227
Method
and_then
* Returns `None` if `self` is `None`, otherwise calls `fn` with the wrapped value. * This is the monadic bind operation (flatMap).
src/option.ts:113
Method
and_then
(fn: (arg: T) => Option<U>)
src/option.ts:367
Method
and_then
* On None, `and_then` returns None with updated type parameter.
src/option.ts:558
Method
and_then
(fn: (arg: T) => Result<U, E>)
src/result.ts:382
Method
and_then
* On Err, `and_then` returns self. We construct a new ResultErr with updated value type.
src/result.ts:557
Method
constructor
(public value: T)
src/option.ts:308
Method
constructor
(private readonly promise: Promise<Result<T, E>>)
src/result-async.ts:42
Method
constructor
(readonly value: T)
src/result.ts:295
Method
constructor
(readonly value: E)
src/result.ts:466
Method
constructor
(private readonly promise: Promise<Option<T>>)
src/option-async.ts:35
Method
err
* Creates a failed ResultAsync containing the error.
src/result-async.ts:65
Method
err
()
src/result.ts:319
Method
err
()
src/result.ts:490
Method
expect
* Returns the contained `Some` value, or throws with the provided message. * * @throws Error with `msg` if this is `None`
src/option.ts:76
Method
expect
(_msg: string)
src/option.ts:328
Method
expect
(msg: string)
src/option.ts:511
Method
expect
* Unwraps the Ok value, or throws with the provided message.
src/result-async.ts:416
Method
expect
(_msg: string)
src/result.ts:361
Method
expect
(msg: string)
src/result.ts:530
Method
expect
* Unwraps the Some value, or throws with the provided message.
src/option-async.ts:318
Method
expectErr
* Unwraps the Err value, or throws with the provided message.
src/result-async.ts:432
Method
expect_err
(msg: string)
src/result.ts:369
Method
expect_err
(_msg: string)
src/result.ts:538
Method
filter
(predicate: (arg: T) => boolean)
src/option.ts:394
Method
filter
* On None, filter returns None.
src/option.ts:578
Method
filter
* Filters the Some value using a predicate.
src/option-async.ts:297
Method
flatten
()
src/option.ts:438
Method
flatten
()
src/option.ts:612
Method
flatten
* Flattens a ResultAsync<Result<U, E>, E> into ResultAsync<U, E>.
src/result-async.ts:519
Method
flatten
* Flattens a `Result<Result<U, E2>, E>` into `Result<U, E | E2>`. * * If `T` is not a `Result`, returns `Result<T, E>` unchanged.
src/result.ts:198
Method
flatten
()
src/result.ts:410
Method
flatten
()
src/result.ts:579
Method
flatten
* Flattens an OptionAsync<Option<U>> into OptionAsync<U>.
src/option-async.ts:375
Method
fromPromise
* Wraps a Promise, converting resolution to Some and rejection to None. * * @example * ```typescript * const result = await Option
src/option-async.ts:70
Method
inspect
* Calls `fn` with the contained value for side effects, then returns the original option. * * @example * ```typescript * Some(5)
src/option.ts:100
Method
inspect
(f: (val: T) => void)
src/option.ts:357
Method
inspect
(_f: (val: T) => void)
src/option.ts:543
Method
inspect
* Calls the function with the Ok value for side effects.
src/result-async.ts:471
Method
inspect
(f: (val: T) => void)
src/result.ts:346
Method
inspect
(_f: (val: T) => void)
src/result.ts:515
Method
inspect
* Calls the function with the Some value for side effects.
src/option-async.ts:357
Method
inspect_err
(_f: (val: E) => void)
src/result.ts:351
Method
inspect_err
(f: (val: E) => void)
src/result.ts:519
Method
into_err
()
src/result.ts:423
Method
into_err
()
src/result.ts:588
Method
into_ok
()
src/result.ts:419
Method
into_ok
()
src/result.ts:584
Method
is_err
()
src/result.ts:302
Method
is_err
()
src/result.ts:473
Method
is_err_and
(_f: (value: E) => boolean)
src/result.ts:310
Method
is_err_and
(f: (value: E) => boolean)
src/result.ts:481
Method
is_none
()
src/option.ts:319
Method
is_none
()
src/option.ts:502
Method
is_none_or
(f: (arg: T) => boolean)
src/option.ts:323
Method
is_none_or
(_f: (arg: T) => boolean)
src/option.ts:506
Method
is_ok
()
src/result.ts:298
Method
is_ok
()
src/result.ts:469
Method
is_ok_and
(f: (value: T) => boolean)
src/result.ts:306
Method
is_ok_and
(_f: (value: T) => boolean)
src/result.ts:477
Method
is_some
()
src/option.ts:311
Method
is_some
()
src/option.ts:494
Method
is_some_and
(f: (arg: T) => boolean)
src/option.ts:315
Method
is_some_and
(_f: (arg: T) => boolean)
src/option.ts:498
Method
iter
()
src/result.ts:356
Method
iter
()
src/result.ts:525
Method
map
* Maps an `Option<T>` to `Option<U>` by applying `fn` to the contained value.
src/option.ts:83
Method
map
(fn: (arg: T) => U)
src/option.ts:349
Method
map
* On None, map returns None with updated type parameter.
src/option.ts:535
Method
map
* Maps the Ok value using a sync or async function. * * @example * ```typescript * const result = ResultAsync.ok(5) * .ma
src/result-async.ts:261
Method
map
(fn: (arg: T) => U)
src/result.ts:324
Method
map
* On Err, map is a no-op that changes only the value type parameter.
src/result.ts:498
Method
map
* Maps the Some value using a sync or async function.
src/option-async.ts:183
Method
mapOr
* Maps the Some value, returning a default if None.
src/option-async.ts:198
Method
mapOrElse
* Maps the Some value, computing a default if None.
src/option-async.ts:209
Method
map_err
* On Ok, map_err is a no-op that changes only the error type parameter. * We construct a new ResultOk with the same value but updated type parame
src/result.ts:340
Method
map_err
(fn: (arg: E) => U)
src/result.ts:510
Method
map_or
* Returns the provided default (if `None`), or applies `fn` to the contained value.
src/option.ts:88
Method
map_or
(_defaultVal: U, fn: (arg: T) => U)
src/option.ts:353
Method
map_or
(defaultVal: U, _fn: (arg: T) => U)
src/option.ts:539
Method
map_or
(_d: U, f: (arg: T) => U)
src/result.ts:328
Method
map_or
(d: U, _f: (arg: T) => U)
src/result.ts:502
Method
map_or_else
(_d: (e: E) => U, f: (arg: T) => U)
src/result.ts:332
Method
map_or_else
(d: (e: E) => U, _f: (arg: T) => U)
src/result.ts:506
Method
match
* Pattern matches on the option, calling the appropriate handler.
src/option-async.ts:428
Method
ok
* Creates a successful ResultAsync containing the value.
src/result-async.ts:58
Method
ok
()
src/result.ts:315
Method
ok
()
src/result.ts:486
Method
ok_or
(_err: E)
src/option.ts:451
Method
ok_or
(err: E)
src/option.ts:617
Method
ok_or_else
(_err: () => E)
src/option.ts:455
Method
ok_or_else
(err: () => E)
src/option.ts:621
Method
or
* Returns `self` if `Some`, otherwise returns `opt`.
src/option.ts:118
Method
or
* On Some, `or` returns self. * Returns this instance typed as Option<T | U> for type compatibility.
src/option.ts:375
Method
or
(opt: Option<U>)
src/option.ts:562
← previous
next →
101–200 of 264, ranked by callers