Type Parameters

  • T
  • E

Implements

Constructors

Properties

_promise: any

Methods

  • Type Parameters

    • A

    Parameters

    • ok: ((t: T) => A)
        • (t: T): A
        • Parameters

          Returns A

    • _err: ((e: E) => A)
        • (e: E): A
        • Parameters

          Returns A

    Returns Promise<A>

  • Emulates Rust's ? operator in safeTry's body. See also safeTry.

    Returns AsyncGenerator<Err<never, E>, T, unknown>

  • Type Parameters

    • A

    Parameters

    Returns Promise<T | A>

  • Type Parameters

    • T
    • E

    Parameters

    • promise: PromiseLike<T>
    • errorFn: ((e: unknown) => E)
        • (e: unknown): E
        • Parameters

          • e: unknown

          Returns E

    Returns ResultAsync<T, E>

  • Type Parameters

    • A extends readonly any[]
    • R
    • E

    Parameters

    • fn: ((...args: A) => Promise<R>)
    • Optional errorFn: ((err: unknown) => E)
        • (err: unknown): E
        • Parameters

          • err: unknown

          Returns E

    Returns ((...args: A) => ResultAsync<R, E>)