Codec

object Codec
Companion:
class
class Object
trait Matchable
class Any
Codec.type

Value members

Concrete methods

def fromEncoderAndDecoder[E, D](encoder: Encoder[D, E])(decoder: Decoder[E, D]): Codec[E, D]
def parseStringCatchingExceptions[A](`type`: String, parse: String => A, print: A => String): Codec[String, A]

Produce a codec to/from a string. If the parsing function fails, the decoding output is an Invalid with a message mentioning the type name.

Produce a codec to/from a string. If the parsing function fails, the decoding output is an Invalid with a message mentioning the type name.

Value parameters:
parse

parsing function to use, with exceptions turned into Invalid

print

printing function to use, not supposed to throw exceptions

type

name of the type being decoded

def sequentially[A, B, C](ab: Codec[A, B])(bc: Codec[B, C]): Codec[A, C]

Combines two codecs, sequentially, by feeding the input of the second one with the output of the first one

Combines two codecs, sequentially, by feeding the input of the second one with the output of the first one