Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UnionLayoutDiscriminator

An object that can provide a discriminator API for Union using an unsigned integral Layout instance located either inside or outside the union.

param layout

initializes {@link UnionLayoutDiscriminator#layout|layout}. Must satisfy {@link ExternalLayout#isCount|isCount()}.

param [property]

Default for {@link UnionDiscriminator#property|property}, superseding the property from layout, but defaulting to variant if neither property nor layout provide a property name.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

layout

property

property: string

Methods

decode

  • decode(b: Uint8Array, offset?: number): number
  • Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}.

    Parameters

    • b: Uint8Array
    • Optional offset: number

    Returns number

encode

  • encode(src: number, b: Uint8Array, offset?: number): number
  • Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}.

    Parameters

    • src: number
    • b: Uint8Array
    • Optional offset: number

    Returns number

Generated using TypeDoc