FieldedText TypeScript Library
    Preparing search index...

    Class FtOk<T, E>

    Represents a successful result.

    This class is used as the success branch of Result. It stores the produced value and exposes type guards for narrowing the result.

    Type Parameters

    • T

      The value type carried by the successful result.

    • E

      The error type kept for compatibility with the Result union.

    Index
    • Creates a successful result with the provided value.

      Type Parameters

      • T

        The value type carried by the successful result.

      • E

        The error type kept for compatibility with the Result union.

      Parameters

      • value: T

        The value produced by the successful operation.

      Returns FtOk<T, E>

    value: T
    • Returns true when this instance represents a failed result.

      This is always false for Ok.

      Returns this is FtErr<T, E>

    • Returns true when this instance represents a successful result.

      This method is intended for type narrowing when handling a Result.

      Returns this is FtOk<T, E>