Typeberry by Fluffy Labs - v0.4.0
    Preparing search index...

    Variable Result

    Result: {
        error: <Error>(
            error: Error,
            details: () => string,
        ) => pvm.ErrorResult<Error>;
        ok: <Ok>(ok: Ok) => pvm.OkResult<Ok>;
        taggedError: <Ok, Kind extends string | number, Nested>(
            enumMapping: EnumMapping,
            kind: Kind,
            nested: pvm.ErrorResult<Nested>,
        ) => pvm.Result<Ok, RichTaggedError<Kind, Nested>>;
    }

    An indication of two possible outcomes returned from a function.

    Type Declaration

    • error: <Error>(error: Error, details: () => string) => pvm.ErrorResult<Error>

      Create new [Result] with Error status.

    • ok: <Ok>(ok: Ok) => pvm.OkResult<Ok>

      Create new [Result] with Ok status.

    • taggedError: <Ok, Kind extends string | number, Nested>(
          enumMapping: EnumMapping,
          kind: Kind,
          nested: pvm.ErrorResult<Nested>,
      ) => pvm.Result<Ok, RichTaggedError<Kind, Nested>>

      Create new [Result] with Error coming from a nested error type.