Skip to content

Many[A: Any val]

[Source]

Decode elements repeatedly until the input is exhausted.

Stops on InsufficientData (not enough bytes for another element). Propagates MalformedData as an error — a corrupt element stops the parse rather than being silently treated as "incomplete."

On encode, encodes each element in sequence.

class val Many[A: Any val] is
  Codec[Array[A] val] val

Implements


Constructors

create

[Source]

new val create(
  codec: Codec[A] val)
: Many[A] val^

Parameters

Returns


Public Functions

decode

[Source]

Decode elements until InsufficientData signals no more fit.

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

Parameters

Returns


encode

[Source]

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

Parameters

Returns