Creates a generalized codec from an encoder and a decoder.
Provides syntax for summoning a GenCodec[A, B]
from implicit scope.
Creates a decoder that decodes with each of the specified decoders, returning the first successful result.
Creates a decoder that decodes with each of the specified decoders, returning the first successful result.
Creates an encoder that encodes with each of the specified encoders, returning the first successful result.
Creates an encoder that encodes with each of the specified encoders, returning the first successful result.
Repeatedly decodes values of type A
from the specified vector, converts each value to a B
and appends it to an accumulator of type
B
using the supplied zero
value and append
function.
Repeatedly decodes values of type A
from the specified vector, converts each value to a B
and appends it to an accumulator of type
B
using the supplied zero
value and append
function. Terminates when no more bits are available in the vector. Exits upon first decoding error.
tuple consisting of the terminating error if any and the accumulated value
Decodes a tuple (A, B)
by first decoding A
and then using the remaining bits to decode B
.
Decodes a tuple (A, B)
by first decoding A
and then using the remaining bits to decode B
.
Decodes a C
by first decoding A
and then using the remaining bits to decode B
, then applying the decoded values to the specified function to generate a C
.
Decodes a C
by first decoding A
and then using the remaining bits to decode B
, then applying the decoded values to the specified function to generate a C
.
Repeatedly decodes values of type A
from the specified vector and returns a collection of the specified type.
Repeatedly decodes values of type A
from the specified vector and returns a collection of the specified type.
Terminates when no more bits are available in the vector or when limit
is defined and that many records have been
decoded. Exits upon first decoding error.
Encodes the specified values, one after the other, to a bit vector using the specified encoders.
Encodes the specified values, one after the other, to a bit vector using the specified encoders.
Encodes all elements of the specified sequence and concatenates the results, or returns the first encountered error.
Encodes all elements of the specified sequence and concatenates the results, or returns the first encountered error.
Companion for GenCodec.