Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DecodeFailure<In, Out, Err>

Type that represent a failed decoding.

Type parameters

  • In

  • Out

  • Err

Hierarchy

Index

Constructors

constructor

  • new DecodeFailure(input: In, ...failures: Err[]): DecodeFailure
  • Contruct an instance of DecodeFailure.

    Parameters

    • input: In

      The input value that corresponds to the place where the decoder failed to generate a valid result.

    • Rest ...failures: Err[]

      The error messages associated with the reason why the decoder failed.

    Returns DecodeFailure

Properties

_E

_E: Err

These placeholder (_I, _O, _E) types are not expected to bring any value. They exist to allow inspecting the main types of a DecodeResult at compile time.

_I

_I: In

See _E.

_O

_O: Out

See _E.

failures

failures: Err[]

Contains all the possible reasons of why a decoder failed.

input

input: In

kind

kind: "decode-failure" = "decode-failure"

Type discriminator

Methods

flatMap

flatMapError

  • flatMapError<Err2>(f: function): DecodeResult<In, Out, Err2>

getUnsafeFailures

  • getUnsafeFailures(): Err[]

getUnsafeSuccess

  • getUnsafeSuccess(): Out

isFailure

  • isFailure(): boolean

isSuccess

  • isSuccess(): boolean

map

mapError

mapInput

match

  • match<O>(o: object): O

toString

  • toString(): string