Skip to content

ThenConst[A: Any val]

[Source]

Decode a value followed by a literal, keeping only the value. On encode, write the value followed by the literal.

class val ThenConst[A: Any val] is
  Codec[A] val

Implements


Constructors

create

[Source]

new val create(
  codec: Codec[A] val,
  literal: Literal val)
: ThenConst[A] val^

Parameters

Returns


Public Functions

decode

[Source]

fun box decode(
  data: Array[U8 val] val,
  offset: USize val)
: ((A , USize val) | DecodeError)

Parameters

Returns


encode

[Source]

fun box encode(
  value: A)
: (Array[U8 val] val | EncodeError)

Parameters

  • value: A

Returns